Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Create array containing variables and their values
compact(array|string $var_name, array|string ...$var_names): array
$expiration = $this->getTime() + $seconds;
try {
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (Exception $e) {
$result = $this->table()->where('key', $key)->update(compact('value', 'expiration'));
try {
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (Exception $e) {
$result = $this->table()->where('key', $key)->update(compact('value', 'expiration'));
try {
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (Exception $e) {
$result = $this->table()->where('key', $key)->update(compact('value', 'expiration'));
return $result > 0;
}
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (Exception $e) {
$result = $this->table()->where('key', $key)->update(compact('value', 'expiration'));
return $result > 0;
}
$expiration = $this->getTime() + $seconds;
try {
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (QueryException $e) {
return $this->table()
->where('key', $key)
try {
return $this->table()->insert(compact('key', 'value', 'expiration'));
} catch (QueryException $e) {
return $this->table()
->where('key', $key)
$time = $expire - $this->currentTime();
return compact('data', 'time');
}
return compact('data', 'time');
}
$concrete = $this->getClosure($abstract, $concrete);
}
$this->bindings[$abstract] = compact('concrete', 'shared');
}
$this->bindings[$abstract] = compact('concrete', 'shared');
protected function paginator($items, $total, $perPage, $currentPage, $options)
{
return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact(
'items', 'total', 'perPage', 'currentPage', 'options'
));
}
{
return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact(
'items', 'total', 'perPage', 'currentPage', 'options'
));
}
protected function simplePaginator($items, $perPage, $currentPage, $options)
{
return Container::getInstance()->makeWith(Paginator::class, compact(
'items', 'perPage', 'currentPage', 'options'
));
}
{
return Container::getInstance()->makeWith(Paginator::class, compact(
'items', 'perPage', 'currentPage', 'options'
));
}
protected function cursorPaginator($items, $perPage, $cursor, $options)
{
return Container::getInstance()->makeWith(CursorPaginator::class, compact(
'items', 'perPage', 'cursor', 'options'
));
}
{
return Container::getInstance()->makeWith(CursorPaginator::class, compact(
'items', 'perPage', 'cursor', 'options'
));
}
$this->event(new QueryExecuted($query, $bindings, $time, $this));
if ($this->loggingQueries) {
$this->queryLog[] = compact('query', 'bindings', 'time');
}
}
if ($this->loggingQueries) {
$this->queryLog[] = compact('query', 'bindings', 'time');
}
}
throw new InvalidArgumentException('The provided value may not be null.');
}
$this->pivotValues[] = compact('column', 'value');
return $this->wherePivot($column, '=', $value);
}
}
$this->pivotValues[] = compact('column', 'value');
return $this->wherePivot($column, '=', $value);
}
$result = parent::__call($method, $parameters);
if (in_array($method, ['select', 'selectRaw', 'selectSub', 'addSelect', 'withoutGlobalScopes'])) {
$this->macroBuffer[] = compact('method', 'parameters');
}
return $result;
if (in_array($method, ['select', 'selectRaw', 'selectSub', 'addSelect', 'withoutGlobalScopes'])) {
$this->macroBuffer[] = compact('method', 'parameters');
}
return $result;
catch (BadMethodCallException $e) {
$this->macroBuffer[] = compact('method', 'parameters');
return $this;
}
$this->macroBuffer[] = compact('method', 'parameters');
return $this;
}
})->all();
return $this->rollbackMigrations(
$migrations, $paths, compact('pretend')
);
}
return $this->rollbackMigrations(
$migrations, $paths, compact('pretend')
);
}
$this->wheres[] = compact(
'type', 'column', 'operator', 'value', 'boolean'
);
if (! $value instanceof Expression) {
$this->addBinding($this->flattenValue($value), 'where');
'type', 'column', 'operator', 'value', 'boolean'
);
if (! $value instanceof Expression) {
$this->addBinding($this->flattenValue($value), 'where');
$type = 'Column';
$this->wheres[] = compact(
'type', 'first', 'operator', 'second', 'boolean'
);
return $this;
}
$this->wheres[] = compact(
'type', 'first', 'operator', 'second', 'boolean'
);
return $this;
}