id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
205,900
laravel/framework
src/Illuminate/View/FileViewFinder.php
FileViewFinder.addExtension
public function addExtension($extension) { if (($index = array_search($extension, $this->extensions)) !== false) { unset($this->extensions[$index]); } array_unshift($this->extensions, $extension); }
php
public function addExtension($extension) { if (($index = array_search($extension, $this->extensions)) !== false) { unset($this->extensions[$index]); } array_unshift($this->extensions, $extension); }
[ "public", "function", "addExtension", "(", "$", "extension", ")", "{", "if", "(", "(", "$", "index", "=", "array_search", "(", "$", "extension", ",", "$", "this", "->", "extensions", ")", ")", "!==", "false", ")", "{", "unset", "(", "$", "this", "->"...
Register an extension with the view finder. @param string $extension @return void
[ "Register", "an", "extension", "with", "the", "view", "finder", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/FileViewFinder.php#L240-L247
205,901
laravel/framework
src/Illuminate/Bus/Queueable.php
Queueable.chain
public function chain($chain) { $this->chained = collect($chain)->map(function ($job) { return serialize($job); })->all(); return $this; }
php
public function chain($chain) { $this->chained = collect($chain)->map(function ($job) { return serialize($job); })->all(); return $this; }
[ "public", "function", "chain", "(", "$", "chain", ")", "{", "$", "this", "->", "chained", "=", "collect", "(", "$", "chain", ")", "->", "map", "(", "function", "(", "$", "job", ")", "{", "return", "serialize", "(", "$", "job", ")", ";", "}", ")",...
Set the jobs that should run if this job is successful. @param array $chain @return $this
[ "Set", "the", "jobs", "that", "should", "run", "if", "this", "job", "is", "successful", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Bus/Queueable.php#L122-L129
205,902
laravel/framework
src/Illuminate/Bus/Queueable.php
Queueable.dispatchNextJobInChain
public function dispatchNextJobInChain() { if (! empty($this->chained)) { dispatch(tap(unserialize(array_shift($this->chained)), function ($next) { $next->chained = $this->chained; $next->onConnection($next->connection ?: $this->chainConnection); ...
php
public function dispatchNextJobInChain() { if (! empty($this->chained)) { dispatch(tap(unserialize(array_shift($this->chained)), function ($next) { $next->chained = $this->chained; $next->onConnection($next->connection ?: $this->chainConnection); ...
[ "public", "function", "dispatchNextJobInChain", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "chained", ")", ")", "{", "dispatch", "(", "tap", "(", "unserialize", "(", "array_shift", "(", "$", "this", "->", "chained", ")", ")", ",", ...
Dispatch the next job on the chain. @return void
[ "Dispatch", "the", "next", "job", "on", "the", "chain", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Bus/Queueable.php#L136-L149
205,903
laravel/framework
src/Illuminate/Container/Container.php
Container.when
public function when($concrete) { $aliases = []; foreach (Arr::wrap($concrete) as $c) { $aliases[] = $this->getAlias($c); } return new ContextualBindingBuilder($this, $aliases); }
php
public function when($concrete) { $aliases = []; foreach (Arr::wrap($concrete) as $c) { $aliases[] = $this->getAlias($c); } return new ContextualBindingBuilder($this, $aliases); }
[ "public", "function", "when", "(", "$", "concrete", ")", "{", "$", "aliases", "=", "[", "]", ";", "foreach", "(", "Arr", "::", "wrap", "(", "$", "concrete", ")", "as", "$", "c", ")", "{", "$", "aliases", "[", "]", "=", "$", "this", "->", "getAl...
Define a contextual binding. @param array|string $concrete @return \Illuminate\Contracts\Container\ContextualBindingBuilder
[ "Define", "a", "contextual", "binding", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L142-L151
205,904
laravel/framework
src/Illuminate/Container/Container.php
Container.resolved
public function resolved($abstract) { if ($this->isAlias($abstract)) { $abstract = $this->getAlias($abstract); } return isset($this->resolved[$abstract]) || isset($this->instances[$abstract]); }
php
public function resolved($abstract) { if ($this->isAlias($abstract)) { $abstract = $this->getAlias($abstract); } return isset($this->resolved[$abstract]) || isset($this->instances[$abstract]); }
[ "public", "function", "resolved", "(", "$", "abstract", ")", "{", "if", "(", "$", "this", "->", "isAlias", "(", "$", "abstract", ")", ")", "{", "$", "abstract", "=", "$", "this", "->", "getAlias", "(", "$", "abstract", ")", ";", "}", "return", "iss...
Determine if the given abstract type has been resolved. @param string $abstract @return bool
[ "Determine", "if", "the", "given", "abstract", "type", "has", "been", "resolved", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L180-L188
205,905
laravel/framework
src/Illuminate/Container/Container.php
Container.tag
public function tag($abstracts, $tags) { $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); foreach ($tags as $tag) { if (! isset($this->tags[$tag])) { $this->tags[$tag] = []; } foreach ((array) $abstracts as $abstract) { ...
php
public function tag($abstracts, $tags) { $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); foreach ($tags as $tag) { if (! isset($this->tags[$tag])) { $this->tags[$tag] = []; } foreach ((array) $abstracts as $abstract) { ...
[ "public", "function", "tag", "(", "$", "abstracts", ",", "$", "tags", ")", "{", "$", "tags", "=", "is_array", "(", "$", "tags", ")", "?", "$", "tags", ":", "array_slice", "(", "func_get_args", "(", ")", ",", "1", ")", ";", "foreach", "(", "$", "t...
Assign a set of tags to a given binding. @param array|string $abstracts @param array|mixed ...$tags @return void
[ "Assign", "a", "set", "of", "tags", "to", "a", "given", "binding", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L441-L454
205,906
laravel/framework
src/Illuminate/Container/Container.php
Container.refresh
public function refresh($abstract, $target, $method) { return $this->rebinding($abstract, function ($app, $instance) use ($target, $method) { $target->{$method}($instance); }); }
php
public function refresh($abstract, $target, $method) { return $this->rebinding($abstract, function ($app, $instance) use ($target, $method) { $target->{$method}($instance); }); }
[ "public", "function", "refresh", "(", "$", "abstract", ",", "$", "target", ",", "$", "method", ")", "{", "return", "$", "this", "->", "rebinding", "(", "$", "abstract", ",", "function", "(", "$", "app", ",", "$", "instance", ")", "use", "(", "$", "...
Refresh an instance on the given target and method. @param string $abstract @param mixed $target @param string $method @return mixed
[ "Refresh", "an", "instance", "on", "the", "given", "target", "and", "method", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L519-L524
205,907
laravel/framework
src/Illuminate/Container/Container.php
Container.getContextualConcrete
protected function getContextualConcrete($abstract) { if (! is_null($binding = $this->findInContextualBindings($abstract))) { return $binding; } // Next we need to see if a contextual binding might be bound under an alias of the // given abstract type. So, we will need t...
php
protected function getContextualConcrete($abstract) { if (! is_null($binding = $this->findInContextualBindings($abstract))) { return $binding; } // Next we need to see if a contextual binding might be bound under an alias of the // given abstract type. So, we will need t...
[ "protected", "function", "getContextualConcrete", "(", "$", "abstract", ")", "{", "if", "(", "!", "is_null", "(", "$", "binding", "=", "$", "this", "->", "findInContextualBindings", "(", "$", "abstract", ")", ")", ")", "{", "return", "$", "binding", ";", ...
Get the contextual concrete binding for the given abstract. @param string $abstract @return \Closure|string|null
[ "Get", "the", "contextual", "concrete", "binding", "for", "the", "given", "abstract", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L728-L746
205,908
laravel/framework
src/Illuminate/Container/Container.php
Container.resolvePrimitive
protected function resolvePrimitive(ReflectionParameter $parameter) { if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->name))) { return $concrete instanceof Closure ? $concrete($this) : $concrete; } if ($parameter->isDefaultValueAvailable()) { r...
php
protected function resolvePrimitive(ReflectionParameter $parameter) { if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->name))) { return $concrete instanceof Closure ? $concrete($this) : $concrete; } if ($parameter->isDefaultValueAvailable()) { r...
[ "protected", "function", "resolvePrimitive", "(", "ReflectionParameter", "$", "parameter", ")", "{", "if", "(", "!", "is_null", "(", "$", "concrete", "=", "$", "this", "->", "getContextualConcrete", "(", "'$'", ".", "$", "parameter", "->", "name", ")", ")", ...
Resolve a non-class hinted primitive dependency. @param \ReflectionParameter $parameter @return mixed @throws \Illuminate\Contracts\Container\BindingResolutionException
[ "Resolve", "a", "non", "-", "class", "hinted", "primitive", "dependency", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L901-L912
205,909
laravel/framework
src/Illuminate/Container/Container.php
Container.notInstantiable
protected function notInstantiable($concrete) { if (! empty($this->buildStack)) { $previous = implode(', ', $this->buildStack); $message = "Target [$concrete] is not instantiable while building [$previous]."; } else { $message = "Target [$concrete] is not instant...
php
protected function notInstantiable($concrete) { if (! empty($this->buildStack)) { $previous = implode(', ', $this->buildStack); $message = "Target [$concrete] is not instantiable while building [$previous]."; } else { $message = "Target [$concrete] is not instant...
[ "protected", "function", "notInstantiable", "(", "$", "concrete", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "buildStack", ")", ")", "{", "$", "previous", "=", "implode", "(", "', '", ",", "$", "this", "->", "buildStack", ")", ";", "$...
Throw an exception that the concrete is not instantiable. @param string $concrete @return void @throws \Illuminate\Contracts\Container\BindingResolutionException
[ "Throw", "an", "exception", "that", "the", "concrete", "is", "not", "instantiable", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L948-L959
205,910
laravel/framework
src/Illuminate/Container/Container.php
Container.fireAfterResolvingCallbacks
protected function fireAfterResolvingCallbacks($abstract, $object) { $this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks); $this->fireCallbackArray( $object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks) ); }
php
protected function fireAfterResolvingCallbacks($abstract, $object) { $this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks); $this->fireCallbackArray( $object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks) ); }
[ "protected", "function", "fireAfterResolvingCallbacks", "(", "$", "abstract", ",", "$", "object", ")", "{", "$", "this", "->", "fireCallbackArray", "(", "$", "object", ",", "$", "this", "->", "globalAfterResolvingCallbacks", ")", ";", "$", "this", "->", "fireC...
Fire all of the after resolving callbacks. @param string $abstract @param mixed $object @return void
[ "Fire", "all", "of", "the", "after", "resolving", "callbacks", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L1041-L1048
205,911
laravel/framework
src/Illuminate/Container/Container.php
Container.getCallbacksForType
protected function getCallbacksForType($abstract, $object, array $callbacksPerType) { $results = []; foreach ($callbacksPerType as $type => $callbacks) { if ($type === $abstract || $object instanceof $type) { $results = array_merge($results, $callbacks); } ...
php
protected function getCallbacksForType($abstract, $object, array $callbacksPerType) { $results = []; foreach ($callbacksPerType as $type => $callbacks) { if ($type === $abstract || $object instanceof $type) { $results = array_merge($results, $callbacks); } ...
[ "protected", "function", "getCallbacksForType", "(", "$", "abstract", ",", "$", "object", ",", "array", "$", "callbacksPerType", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "$", "callbacksPerType", "as", "$", "type", "=>", "$", "callbacks...
Get all callbacks for a given type. @param string $abstract @param object $object @param array $callbacksPerType @return array
[ "Get", "all", "callbacks", "for", "a", "given", "type", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/Container.php#L1059-L1070
205,912
laravel/framework
src/Illuminate/Database/Eloquent/Relations/MorphTo.php
MorphTo.replayMacros
protected function replayMacros(Builder $query) { foreach ($this->macroBuffer as $macro) { $query->{$macro['method']}(...$macro['parameters']); } return $query; }
php
protected function replayMacros(Builder $query) { foreach ($this->macroBuffer as $macro) { $query->{$macro['method']}(...$macro['parameters']); } return $query; }
[ "protected", "function", "replayMacros", "(", "Builder", "$", "query", ")", "{", "foreach", "(", "$", "this", "->", "macroBuffer", "as", "$", "macro", ")", "{", "$", "query", "->", "{", "$", "macro", "[", "'method'", "]", "}", "(", "...", "$", "macro...
Replay stored macro calls on the actual related instance. @param \Illuminate\Database\Eloquent\Builder $query @return \Illuminate\Database\Eloquent\Builder
[ "Replay", "stored", "macro", "calls", "on", "the", "actual", "related", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php#L262-L269
205,913
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.resolveTableName
protected function resolveTableName($table) { if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } $model = new $table; if (! $model instanceof Model) { return $table; } if ($model instanceof Pivot) { $...
php
protected function resolveTableName($table) { if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } $model = new $table; if (! $model instanceof Model) { return $table; } if ($model instanceof Pivot) { $...
[ "protected", "function", "resolveTableName", "(", "$", "table", ")", "{", "if", "(", "!", "Str", "::", "contains", "(", "$", "table", ",", "'\\\\'", ")", "||", "!", "class_exists", "(", "$", "table", ")", ")", "{", "return", "$", "table", ";", "}", ...
Attempt to resolve the intermediate table name from the given string. @param string $table @return string
[ "Attempt", "to", "resolve", "the", "intermediate", "table", "name", "from", "the", "given", "string", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L160-L177
205,914
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.orWherePivot
public function orWherePivot($column, $operator = null, $value = null) { return $this->wherePivot($column, $operator, $value, 'or'); }
php
public function orWherePivot($column, $operator = null, $value = null) { return $this->wherePivot($column, $operator, $value, 'or'); }
[ "public", "function", "orWherePivot", "(", "$", "column", ",", "$", "operator", "=", "null", ",", "$", "value", "=", "null", ")", "{", "return", "$", "this", "->", "wherePivot", "(", "$", "column", ",", "$", "operator", ",", "$", "value", ",", "'or'"...
Set an "or where" clause for a pivot table column. @param string $column @param string $operator @param mixed $value @return $this
[ "Set", "an", "or", "where", "clause", "for", "a", "pivot", "table", "column", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L383-L386
205,915
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.firstOrCreate
public function firstOrCreate(array $attributes, array $joining = [], $touch = true) { if (is_null($instance = $this->where($attributes)->first())) { $instance = $this->create($attributes, $joining, $touch); } return $instance; }
php
public function firstOrCreate(array $attributes, array $joining = [], $touch = true) { if (is_null($instance = $this->where($attributes)->first())) { $instance = $this->create($attributes, $joining, $touch); } return $instance; }
[ "public", "function", "firstOrCreate", "(", "array", "$", "attributes", ",", "array", "$", "joining", "=", "[", "]", ",", "$", "touch", "=", "true", ")", "{", "if", "(", "is_null", "(", "$", "instance", "=", "$", "this", "->", "where", "(", "$", "a...
Get the first related record matching the attributes or create it. @param array $attributes @param array $joining @param bool $touch @return \Illuminate\Database\Eloquent\Model
[ "Get", "the", "first", "related", "record", "matching", "the", "attributes", "or", "create", "it", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L467-L474
205,916
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.find
public function find($id, $columns = ['*']) { return is_array($id) ? $this->findMany($id, $columns) : $this->where( $this->getRelated()->getQualifiedKeyName(), '=', $id )->first($columns); }
php
public function find($id, $columns = ['*']) { return is_array($id) ? $this->findMany($id, $columns) : $this->where( $this->getRelated()->getQualifiedKeyName(), '=', $id )->first($columns); }
[ "public", "function", "find", "(", "$", "id", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "return", "is_array", "(", "$", "id", ")", "?", "$", "this", "->", "findMany", "(", "$", "id", ",", "$", "columns", ")", ":", "$", "this", "->", ...
Find a related model by its primary key. @param mixed $id @param array $columns @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null
[ "Find", "a", "related", "model", "by", "its", "primary", "key", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L505-L510
205,917
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.findOrFail
public function findOrFail($id, $columns = ['*']) { $result = $this->find($id, $columns); if (is_array($id)) { if (count($result) === count(array_unique($id))) { return $result; } } elseif (! is_null($result)) { return $result; } ...
php
public function findOrFail($id, $columns = ['*']) { $result = $this->find($id, $columns); if (is_array($id)) { if (count($result) === count(array_unique($id))) { return $result; } } elseif (! is_null($result)) { return $result; } ...
[ "public", "function", "findOrFail", "(", "$", "id", ",", "$", "columns", "=", "[", "'*'", "]", ")", "{", "$", "result", "=", "$", "this", "->", "find", "(", "$", "id", ",", "$", "columns", ")", ";", "if", "(", "is_array", "(", "$", "id", ")", ...
Find a related model by its primary key or throw an exception. @param mixed $id @param array $columns @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection @throws \Illuminate\Database\Eloquent\ModelNotFoundException
[ "Find", "a", "related", "model", "by", "its", "primary", "key", "or", "throw", "an", "exception", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L535-L548
205,918
laravel/framework
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
BelongsToMany.createMany
public function createMany(array $records, array $joinings = []) { $instances = []; foreach ($records as $key => $record) { $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); } $this->touchIfTouching(); return $instances; }
php
public function createMany(array $records, array $joinings = []) { $instances = []; foreach ($records as $key => $record) { $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); } $this->touchIfTouching(); return $instances; }
[ "public", "function", "createMany", "(", "array", "$", "records", ",", "array", "$", "joinings", "=", "[", "]", ")", "{", "$", "instances", "=", "[", "]", ";", "foreach", "(", "$", "records", "as", "$", "key", "=>", "$", "record", ")", "{", "$", ...
Create an array of new instances of the related models. @param array $records @param array $joinings @return array
[ "Create", "an", "array", "of", "new", "instances", "of", "the", "related", "models", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L927-L938
205,919
laravel/framework
src/Illuminate/Auth/AuthManager.php
AuthManager.createSessionDriver
public function createSessionDriver($name, $config) { $provider = $this->createUserProvider($config['provider'] ?? null); $guard = new SessionGuard($name, $provider, $this->app['session.store']); // When using the remember me functionality of the authentication services we // will ...
php
public function createSessionDriver($name, $config) { $provider = $this->createUserProvider($config['provider'] ?? null); $guard = new SessionGuard($name, $provider, $this->app['session.store']); // When using the remember me functionality of the authentication services we // will ...
[ "public", "function", "createSessionDriver", "(", "$", "name", ",", "$", "config", ")", "{", "$", "provider", "=", "$", "this", "->", "createUserProvider", "(", "$", "config", "[", "'provider'", "]", "??", "null", ")", ";", "$", "guard", "=", "new", "S...
Create a session based authentication guard. @param string $name @param array $config @return \Illuminate\Auth\SessionGuard
[ "Create", "a", "session", "based", "authentication", "guard", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/AuthManager.php#L121-L143
205,920
laravel/framework
src/Illuminate/Auth/AuthManager.php
AuthManager.createTokenDriver
public function createTokenDriver($name, $config) { // The token guard implements a basic API token based guard implementation // that takes an API token field from the request and matches it to the // user in the database or another persistence layer where users are. $guard = new To...
php
public function createTokenDriver($name, $config) { // The token guard implements a basic API token based guard implementation // that takes an API token field from the request and matches it to the // user in the database or another persistence layer where users are. $guard = new To...
[ "public", "function", "createTokenDriver", "(", "$", "name", ",", "$", "config", ")", "{", "// The token guard implements a basic API token based guard implementation", "// that takes an API token field from the request and matches it to the", "// user in the database or another persistenc...
Create a token based authentication guard. @param string $name @param array $config @return \Illuminate\Auth\TokenGuard
[ "Create", "a", "token", "based", "authentication", "guard", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/AuthManager.php#L152-L168
205,921
laravel/framework
src/Illuminate/Auth/AuthManager.php
AuthManager.viaRequest
public function viaRequest($driver, callable $callback) { return $this->extend($driver, function () use ($callback) { $guard = new RequestGuard($callback, $this->app['request'], $this->createUserProvider()); $this->app->refresh('request', $guard, 'setRequest'); return $...
php
public function viaRequest($driver, callable $callback) { return $this->extend($driver, function () use ($callback) { $guard = new RequestGuard($callback, $this->app['request'], $this->createUserProvider()); $this->app->refresh('request', $guard, 'setRequest'); return $...
[ "public", "function", "viaRequest", "(", "$", "driver", ",", "callable", "$", "callback", ")", "{", "return", "$", "this", "->", "extend", "(", "$", "driver", ",", "function", "(", ")", "use", "(", "$", "callback", ")", "{", "$", "guard", "=", "new",...
Register a new callback based request guard. @param string $driver @param callable $callback @return $this
[ "Register", "a", "new", "callback", "based", "request", "guard", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/AuthManager.php#L226-L235
205,922
laravel/framework
src/Illuminate/Database/Eloquent/SoftDeletingScope.php
SoftDeletingScope.addWithoutTrashed
protected function addWithoutTrashed(Builder $builder) { $builder->macro('withoutTrashed', function (Builder $builder) { $model = $builder->getModel(); $builder->withoutGlobalScope($this)->whereNull( $model->getQualifiedDeletedAtColumn() ); r...
php
protected function addWithoutTrashed(Builder $builder) { $builder->macro('withoutTrashed', function (Builder $builder) { $model = $builder->getModel(); $builder->withoutGlobalScope($this)->whereNull( $model->getQualifiedDeletedAtColumn() ); r...
[ "protected", "function", "addWithoutTrashed", "(", "Builder", "$", "builder", ")", "{", "$", "builder", "->", "macro", "(", "'withoutTrashed'", ",", "function", "(", "Builder", "$", "builder", ")", "{", "$", "model", "=", "$", "builder", "->", "getModel", ...
Add the without-trashed extension to the builder. @param \Illuminate\Database\Eloquent\Builder $builder @return void
[ "Add", "the", "without", "-", "trashed", "extension", "to", "the", "builder", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/SoftDeletingScope.php#L100-L111
205,923
laravel/framework
src/Illuminate/Foundation/Events/DiscoverEvents.php
DiscoverEvents.within
public static function within($listenerPath, $basePath) { return collect(static::getListenerEvents( (new Finder)->files()->in($listenerPath), $basePath ))->mapToDictionary(function ($event, $listener) { return [$event => $listener]; })->all(); }
php
public static function within($listenerPath, $basePath) { return collect(static::getListenerEvents( (new Finder)->files()->in($listenerPath), $basePath ))->mapToDictionary(function ($event, $listener) { return [$event => $listener]; })->all(); }
[ "public", "static", "function", "within", "(", "$", "listenerPath", ",", "$", "basePath", ")", "{", "return", "collect", "(", "static", "::", "getListenerEvents", "(", "(", "new", "Finder", ")", "->", "files", "(", ")", "->", "in", "(", "$", "listenerPat...
Get all of the events and listeners by searching the given listener directory. @param string $listenerPath @param string $basePath @return array
[ "Get", "all", "of", "the", "events", "and", "listeners", "by", "searching", "the", "given", "listener", "directory", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Events/DiscoverEvents.php#L20-L27
205,924
laravel/framework
src/Illuminate/Foundation/Events/DiscoverEvents.php
DiscoverEvents.getListenerEvents
protected static function getListenerEvents($listeners, $basePath) { $listenerEvents = []; foreach ($listeners as $listener) { $listener = new ReflectionClass( static::classFromFile($listener, $basePath) ); foreach ($listener->getMethods(Reflecti...
php
protected static function getListenerEvents($listeners, $basePath) { $listenerEvents = []; foreach ($listeners as $listener) { $listener = new ReflectionClass( static::classFromFile($listener, $basePath) ); foreach ($listener->getMethods(Reflecti...
[ "protected", "static", "function", "getListenerEvents", "(", "$", "listeners", ",", "$", "basePath", ")", "{", "$", "listenerEvents", "=", "[", "]", ";", "foreach", "(", "$", "listeners", "as", "$", "listener", ")", "{", "$", "listener", "=", "new", "Ref...
Get all of the listeners and their corresponding events. @param iterable $listeners @param string $basePath @return array
[ "Get", "all", "of", "the", "listeners", "and", "their", "corresponding", "events", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Events/DiscoverEvents.php#L36-L57
205,925
laravel/framework
src/Illuminate/Foundation/Events/DiscoverEvents.php
DiscoverEvents.classFromFile
protected static function classFromFile(SplFileInfo $file, $basePath) { $class = trim(str_replace($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR); return str_replace( [DIRECTORY_SEPARATOR, 'App\\'], ['\\', app()->getNamespace()], ucfirst(Str::replaceLa...
php
protected static function classFromFile(SplFileInfo $file, $basePath) { $class = trim(str_replace($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR); return str_replace( [DIRECTORY_SEPARATOR, 'App\\'], ['\\', app()->getNamespace()], ucfirst(Str::replaceLa...
[ "protected", "static", "function", "classFromFile", "(", "SplFileInfo", "$", "file", ",", "$", "basePath", ")", "{", "$", "class", "=", "trim", "(", "str_replace", "(", "$", "basePath", ",", "''", ",", "$", "file", "->", "getRealPath", "(", ")", ")", "...
Extract the class name from the given file path. @param \SplFileInfo $file @param string $basePath @return string
[ "Extract", "the", "class", "name", "from", "the", "given", "file", "path", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Events/DiscoverEvents.php#L66-L75
205,926
laravel/framework
src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php
VerifyCsrfToken.getTokenFromRequest
protected function getTokenFromRequest($request) { $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN'); if (! $token && $header = $request->header('X-XSRF-TOKEN')) { $token = $this->encrypter->decrypt($header, static::serialized()); } return $token; ...
php
protected function getTokenFromRequest($request) { $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN'); if (! $token && $header = $request->header('X-XSRF-TOKEN')) { $token = $this->encrypter->decrypt($header, static::serialized()); } return $token; ...
[ "protected", "function", "getTokenFromRequest", "(", "$", "request", ")", "{", "$", "token", "=", "$", "request", "->", "input", "(", "'_token'", ")", "?", ":", "$", "request", "->", "header", "(", "'X-CSRF-TOKEN'", ")", ";", "if", "(", "!", "$", "toke...
Get the CSRF token from the request. @param \Illuminate\Http\Request $request @return string
[ "Get", "the", "CSRF", "token", "from", "the", "request", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php#L148-L157
205,927
laravel/framework
src/Illuminate/Mail/TransportManager.php
TransportManager.createMandrillDriver
protected function createMandrillDriver() { $config = $this->app['config']->get('services.mandrill', []); return new MandrillTransport( $this->guzzle($config), $config['secret'] ); }
php
protected function createMandrillDriver() { $config = $this->app['config']->get('services.mandrill', []); return new MandrillTransport( $this->guzzle($config), $config['secret'] ); }
[ "protected", "function", "createMandrillDriver", "(", ")", "{", "$", "config", "=", "$", "this", "->", "app", "[", "'config'", "]", "->", "get", "(", "'services.mandrill'", ",", "[", "]", ")", ";", "return", "new", "MandrillTransport", "(", "$", "this", ...
Create an instance of the Mandrill Swift Transport driver. @return \Illuminate\Mail\Transport\MandrillTransport
[ "Create", "an", "instance", "of", "the", "Mandrill", "Swift", "Transport", "driver", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/TransportManager.php#L134-L141
205,928
laravel/framework
src/Illuminate/Mail/TransportManager.php
TransportManager.createLogDriver
protected function createLogDriver() { $logger = $this->app->make(LoggerInterface::class); if ($logger instanceof LogManager) { $logger = $logger->channel($this->app['config']['mail.log_channel']); } return new LogTransport($logger); }
php
protected function createLogDriver() { $logger = $this->app->make(LoggerInterface::class); if ($logger instanceof LogManager) { $logger = $logger->channel($this->app['config']['mail.log_channel']); } return new LogTransport($logger); }
[ "protected", "function", "createLogDriver", "(", ")", "{", "$", "logger", "=", "$", "this", "->", "app", "->", "make", "(", "LoggerInterface", "::", "class", ")", ";", "if", "(", "$", "logger", "instanceof", "LogManager", ")", "{", "$", "logger", "=", ...
Create an instance of the Log Swift Transport driver. @return \Illuminate\Mail\Transport\LogTransport
[ "Create", "an", "instance", "of", "the", "Log", "Swift", "Transport", "driver", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/TransportManager.php#L174-L183
205,929
laravel/framework
src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
PaginatedResourceResponse.paginationInformation
protected function paginationInformation($request) { $paginated = $this->resource->resource->toArray(); return [ 'links' => $this->paginationLinks($paginated), 'meta' => $this->meta($paginated), ]; }
php
protected function paginationInformation($request) { $paginated = $this->resource->resource->toArray(); return [ 'links' => $this->paginationLinks($paginated), 'meta' => $this->meta($paginated), ]; }
[ "protected", "function", "paginationInformation", "(", "$", "request", ")", "{", "$", "paginated", "=", "$", "this", "->", "resource", "->", "resource", "->", "toArray", "(", ")", ";", "return", "[", "'links'", "=>", "$", "this", "->", "paginationLinks", "...
Add the pagination information to the response. @param \Illuminate\Http\Request $request @return array
[ "Add", "the", "pagination", "information", "to", "the", "response", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php#L40-L48
205,930
laravel/framework
src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
PaginatedResourceResponse.paginationLinks
protected function paginationLinks($paginated) { return [ 'first' => $paginated['first_page_url'] ?? null, 'last' => $paginated['last_page_url'] ?? null, 'prev' => $paginated['prev_page_url'] ?? null, 'next' => $paginated['next_page_url'] ?? null, ]; ...
php
protected function paginationLinks($paginated) { return [ 'first' => $paginated['first_page_url'] ?? null, 'last' => $paginated['last_page_url'] ?? null, 'prev' => $paginated['prev_page_url'] ?? null, 'next' => $paginated['next_page_url'] ?? null, ]; ...
[ "protected", "function", "paginationLinks", "(", "$", "paginated", ")", "{", "return", "[", "'first'", "=>", "$", "paginated", "[", "'first_page_url'", "]", "??", "null", ",", "'last'", "=>", "$", "paginated", "[", "'last_page_url'", "]", "??", "null", ",", ...
Get the pagination links for the response. @param array $paginated @return array
[ "Get", "the", "pagination", "links", "for", "the", "response", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php#L56-L64
205,931
laravel/framework
src/Illuminate/Http/Resources/Json/ResourceResponse.php
ResourceResponse.wrap
protected function wrap($data, $with = [], $additional = []) { if ($data instanceof Collection) { $data = $data->all(); } if ($this->haveDefaultWrapperAndDataIsUnwrapped($data)) { $data = [$this->wrapper() => $data]; } elseif ($this->haveAdditionalInformation...
php
protected function wrap($data, $with = [], $additional = []) { if ($data instanceof Collection) { $data = $data->all(); } if ($this->haveDefaultWrapperAndDataIsUnwrapped($data)) { $data = [$this->wrapper() => $data]; } elseif ($this->haveAdditionalInformation...
[ "protected", "function", "wrap", "(", "$", "data", ",", "$", "with", "=", "[", "]", ",", "$", "additional", "=", "[", "]", ")", "{", "if", "(", "$", "data", "instanceof", "Collection", ")", "{", "$", "data", "=", "$", "data", "->", "all", "(", ...
Wrap the given data if necessary. @param array $data @param array $with @param array $additional @return array
[ "Wrap", "the", "given", "data", "if", "necessary", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/ResourceResponse.php#L59-L72
205,932
laravel/framework
src/Illuminate/Http/Resources/Json/ResourceResponse.php
ResourceResponse.haveAdditionalInformationAndDataIsUnwrapped
protected function haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional) { return (! empty($with) || ! empty($additional)) && (! $this->wrapper() || ! array_key_exists($this->wrapper(), $data)); }
php
protected function haveAdditionalInformationAndDataIsUnwrapped($data, $with, $additional) { return (! empty($with) || ! empty($additional)) && (! $this->wrapper() || ! array_key_exists($this->wrapper(), $data)); }
[ "protected", "function", "haveAdditionalInformationAndDataIsUnwrapped", "(", "$", "data", ",", "$", "with", ",", "$", "additional", ")", "{", "return", "(", "!", "empty", "(", "$", "with", ")", "||", "!", "empty", "(", "$", "additional", ")", ")", "&&", ...
Determine if "with" data has been added and our data is unwrapped. @param array $data @param array $with @param array $additional @return bool
[ "Determine", "if", "with", "data", "has", "been", "added", "and", "our", "data", "is", "unwrapped", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Resources/Json/ResourceResponse.php#L93-L98
205,933
laravel/framework
src/Illuminate/Database/Concerns/BuildsQueries.php
BuildsQueries.unless
public function unless($value, $callback, $default = null) { if (! $value) { return $callback($this, $value) ?: $this; } elseif ($default) { return $default($this, $value) ?: $this; } return $this; }
php
public function unless($value, $callback, $default = null) { if (! $value) { return $callback($this, $value) ?: $this; } elseif ($default) { return $default($this, $value) ?: $this; } return $this; }
[ "public", "function", "unless", "(", "$", "value", ",", "$", "callback", ",", "$", "default", "=", "null", ")", "{", "if", "(", "!", "$", "value", ")", "{", "return", "$", "callback", "(", "$", "this", ",", "$", "value", ")", "?", ":", "$", "th...
Apply the callback's query changes if the given "value" is false. @param mixed $value @param callable $callback @param callable $default @return mixed|$this
[ "Apply", "the", "callback", "s", "query", "changes", "if", "the", "given", "value", "is", "false", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Concerns/BuildsQueries.php#L118-L127
205,934
laravel/framework
src/Illuminate/Database/Concerns/BuildsQueries.php
BuildsQueries.simplePaginator
protected function simplePaginator($items, $perPage, $currentPage, $options) { return Container::getInstance()->makeWith(Paginator::class, compact( 'items', 'perPage', 'currentPage', 'options' )); }
php
protected function simplePaginator($items, $perPage, $currentPage, $options) { return Container::getInstance()->makeWith(Paginator::class, compact( 'items', 'perPage', 'currentPage', 'options' )); }
[ "protected", "function", "simplePaginator", "(", "$", "items", ",", "$", "perPage", ",", "$", "currentPage", ",", "$", "options", ")", "{", "return", "Container", "::", "getInstance", "(", ")", "->", "makeWith", "(", "Paginator", "::", "class", ",", "compa...
Create a new simple paginator instance. @param \Illuminate\Support\Collection $items @param int $perPage @param int $currentPage @param array $options @return \Illuminate\Pagination\Paginator
[ "Create", "a", "new", "simple", "paginator", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Concerns/BuildsQueries.php#L155-L160
205,935
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.withoutGlobalScope
public function withoutGlobalScope($scope) { if (! is_string($scope)) { $scope = get_class($scope); } unset($this->scopes[$scope]); $this->removedScopes[] = $scope; return $this; }
php
public function withoutGlobalScope($scope) { if (! is_string($scope)) { $scope = get_class($scope); } unset($this->scopes[$scope]); $this->removedScopes[] = $scope; return $this; }
[ "public", "function", "withoutGlobalScope", "(", "$", "scope", ")", "{", "if", "(", "!", "is_string", "(", "$", "scope", ")", ")", "{", "$", "scope", "=", "get_class", "(", "$", "scope", ")", ";", "}", "unset", "(", "$", "this", "->", "scopes", "["...
Remove a registered global scope. @param \Illuminate\Database\Eloquent\Scope|string $scope @return $this
[ "Remove", "a", "registered", "global", "scope", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L138-L149
205,936
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.oldest
public function oldest($column = null) { if (is_null($column)) { $column = $this->model->getCreatedAtColumn() ?? 'created_at'; } $this->query->oldest($column); return $this; }
php
public function oldest($column = null) { if (is_null($column)) { $column = $this->model->getCreatedAtColumn() ?? 'created_at'; } $this->query->oldest($column); return $this; }
[ "public", "function", "oldest", "(", "$", "column", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "column", ")", ")", "{", "$", "column", "=", "$", "this", "->", "model", "->", "getCreatedAtColumn", "(", ")", "??", "'created_at'", ";", "}", ...
Add an "order by" clause for a timestamp to the query. @param string $column @return $this
[ "Add", "an", "order", "by", "clause", "for", "a", "timestamp", "to", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L276-L285
205,937
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.enforceOrderBy
protected function enforceOrderBy() { if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); } }
php
protected function enforceOrderBy() { if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); } }
[ "protected", "function", "enforceOrderBy", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "query", "->", "orders", ")", "&&", "empty", "(", "$", "this", "->", "query", "->", "unionOrders", ")", ")", "{", "$", "this", "->", "orderBy", "(",...
Add a generic "order by" clause if the query doesn't already have one. @return void
[ "Add", "a", "generic", "order", "by", "clause", "if", "the", "query", "doesn", "t", "already", "have", "one", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L699-L704
205,938
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.scopes
public function scopes(array $scopes) { $builder = $this; foreach ($scopes as $scope => $parameters) { // If the scope key is an integer, then the scope was passed as the value and // the parameter list is empty, so we will format the scope name and these // para...
php
public function scopes(array $scopes) { $builder = $this; foreach ($scopes as $scope => $parameters) { // If the scope key is an integer, then the scope was passed as the value and // the parameter list is empty, so we will format the scope name and these // para...
[ "public", "function", "scopes", "(", "array", "$", "scopes", ")", "{", "$", "builder", "=", "$", "this", ";", "foreach", "(", "$", "scopes", "as", "$", "scope", "=>", "$", "parameters", ")", "{", "// If the scope key is an integer, then the scope was passed as t...
Call the given local model scopes. @param array $scopes @return static|mixed
[ "Call", "the", "given", "local", "model", "scopes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L921-L943
205,939
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.without
public function without($relations) { $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip( is_string($relations) ? func_get_args() : $relations )); return $this; }
php
public function without($relations) { $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip( is_string($relations) ? func_get_args() : $relations )); return $this; }
[ "public", "function", "without", "(", "$", "relations", ")", "{", "$", "this", "->", "eagerLoad", "=", "array_diff_key", "(", "$", "this", "->", "eagerLoad", ",", "array_flip", "(", "is_string", "(", "$", "relations", ")", "?", "func_get_args", "(", ")", ...
Prevent the specified relations from being eager loaded. @param mixed $relations @return $this
[ "Prevent", "the", "specified", "relations", "from", "being", "eager", "loaded", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L1096-L1103
205,940
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.createSelectWithConstraint
protected function createSelectWithConstraint($name) { return [explode(':', $name)[0], function ($query) use ($name) { $query->select(explode(',', explode(':', $name)[1])); }]; }
php
protected function createSelectWithConstraint($name) { return [explode(':', $name)[0], function ($query) use ($name) { $query->select(explode(',', explode(':', $name)[1])); }]; }
[ "protected", "function", "createSelectWithConstraint", "(", "$", "name", ")", "{", "return", "[", "explode", "(", "':'", ",", "$", "name", ")", "[", "0", "]", ",", "function", "(", "$", "query", ")", "use", "(", "$", "name", ")", "{", "$", "query", ...
Create a constraint to select the given columns for the relation. @param string $name @return array
[ "Create", "a", "constraint", "to", "select", "the", "given", "columns", "for", "the", "relation", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L1159-L1164
205,941
laravel/framework
src/Illuminate/Database/Eloquent/Builder.php
Builder.setModel
public function setModel(Model $model) { $this->model = $model; $this->query->from($model->getTable()); return $this; }
php
public function setModel(Model $model) { $this->model = $model; $this->query->from($model->getTable()); return $this; }
[ "public", "function", "setModel", "(", "Model", "$", "model", ")", "{", "$", "this", "->", "model", "=", "$", "model", ";", "$", "this", "->", "query", "->", "from", "(", "$", "model", "->", "getTable", "(", ")", ")", ";", "return", "$", "this", ...
Set a model instance for the model being queried. @param \Illuminate\Database\Eloquent\Model $model @return $this
[ "Set", "a", "model", "instance", "for", "the", "model", "being", "queried", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Builder.php#L1265-L1272
205,942
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.callBeforeCallbacks
public function callBeforeCallbacks(Container $container) { foreach ($this->beforeCallbacks as $callback) { $container->call($callback); } }
php
public function callBeforeCallbacks(Container $container) { foreach ($this->beforeCallbacks as $callback) { $container->call($callback); } }
[ "public", "function", "callBeforeCallbacks", "(", "Container", "$", "container", ")", "{", "foreach", "(", "$", "this", "->", "beforeCallbacks", "as", "$", "callback", ")", "{", "$", "container", "->", "call", "(", "$", "callback", ")", ";", "}", "}" ]
Call all of the "before" callbacks for the event. @param \Illuminate\Contracts\Container\Container $container @return void
[ "Call", "all", "of", "the", "before", "callbacks", "for", "the", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L242-L247
205,943
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.sendOutputTo
public function sendOutputTo($location, $append = false) { $this->output = $location; $this->shouldAppendOutput = $append; return $this; }
php
public function sendOutputTo($location, $append = false) { $this->output = $location; $this->shouldAppendOutput = $append; return $this; }
[ "public", "function", "sendOutputTo", "(", "$", "location", ",", "$", "append", "=", "false", ")", "{", "$", "this", "->", "output", "=", "$", "location", ";", "$", "this", "->", "shouldAppendOutput", "=", "$", "append", ";", "return", "$", "this", ";"...
Send the output of the command to a given location. @param string $location @param bool $append @return $this
[ "Send", "the", "output", "of", "the", "command", "to", "a", "given", "location", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L367-L374
205,944
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.emailOutputOnFailure
public function emailOutputOnFailure($addresses) { $this->ensureOutputIsBeingCaptured(); $addresses = Arr::wrap($addresses); return $this->onFailure(function (Mailer $mailer) use ($addresses) { $this->emailOutput($mailer, $addresses, false); }); }
php
public function emailOutputOnFailure($addresses) { $this->ensureOutputIsBeingCaptured(); $addresses = Arr::wrap($addresses); return $this->onFailure(function (Mailer $mailer) use ($addresses) { $this->emailOutput($mailer, $addresses, false); }); }
[ "public", "function", "emailOutputOnFailure", "(", "$", "addresses", ")", "{", "$", "this", "->", "ensureOutputIsBeingCaptured", "(", ")", ";", "$", "addresses", "=", "Arr", "::", "wrap", "(", "$", "addresses", ")", ";", "return", "$", "this", "->", "onFai...
E-mail the results of the scheduled operation if it fails. @param array|mixed $addresses @return $this
[ "E", "-", "mail", "the", "results", "of", "the", "scheduled", "operation", "if", "it", "fails", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L426-L435
205,945
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.ensureOutputIsBeingCaptured
protected function ensureOutputIsBeingCaptured() { if (is_null($this->output) || $this->output == $this->getDefaultOutput()) { $this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log')); } }
php
protected function ensureOutputIsBeingCaptured() { if (is_null($this->output) || $this->output == $this->getDefaultOutput()) { $this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log')); } }
[ "protected", "function", "ensureOutputIsBeingCaptured", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "output", ")", "||", "$", "this", "->", "output", "==", "$", "this", "->", "getDefaultOutput", "(", ")", ")", "{", "$", "this", "->", "...
Ensure that the command output is being captured. @return void
[ "Ensure", "that", "the", "command", "output", "is", "being", "captured", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L442-L447
205,946
laravel/framework
src/Illuminate/Console/Scheduling/Event.php
Event.onSuccess
public function onSuccess(Closure $callback) { return $this->then(function (Container $container) use ($callback) { if (0 === $this->exitCode) { $container->call($callback); } }); }
php
public function onSuccess(Closure $callback) { return $this->then(function (Container $container) use ($callback) { if (0 === $this->exitCode) { $container->call($callback); } }); }
[ "public", "function", "onSuccess", "(", "Closure", "$", "callback", ")", "{", "return", "$", "this", "->", "then", "(", "function", "(", "Container", "$", "container", ")", "use", "(", "$", "callback", ")", "{", "if", "(", "0", "===", "$", "this", "-...
Register a callback to be called if the operation succeeds. @param \Closure $callback @return $this
[ "Register", "a", "callback", "to", "be", "called", "if", "the", "operation", "succeeds", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Event.php#L714-L721
205,947
laravel/framework
src/Illuminate/Support/Facades/Event.php
Event.fake
public static function fake($eventsToFake = []) { static::swap($fake = new EventFake(static::getFacadeRoot(), $eventsToFake)); Model::setEventDispatcher($fake); return $fake; }
php
public static function fake($eventsToFake = []) { static::swap($fake = new EventFake(static::getFacadeRoot(), $eventsToFake)); Model::setEventDispatcher($fake); return $fake; }
[ "public", "static", "function", "fake", "(", "$", "eventsToFake", "=", "[", "]", ")", "{", "static", "::", "swap", "(", "$", "fake", "=", "new", "EventFake", "(", "static", "::", "getFacadeRoot", "(", ")", ",", "$", "eventsToFake", ")", ")", ";", "Mo...
Replace the bound instance with a fake. @param array|string $eventsToFake @return \Illuminate\Support\Testing\Fakes\EventFake
[ "Replace", "the", "bound", "instance", "with", "a", "fake", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Event.php#L29-L36
205,948
laravel/framework
src/Illuminate/Support/Facades/Event.php
Event.fakeFor
public static function fakeFor(callable $callable, array $eventsToFake = []) { $originalDispatcher = static::getFacadeRoot(); static::fake($eventsToFake); return tap($callable(), function () use ($originalDispatcher) { static::swap($originalDispatcher); Model::setE...
php
public static function fakeFor(callable $callable, array $eventsToFake = []) { $originalDispatcher = static::getFacadeRoot(); static::fake($eventsToFake); return tap($callable(), function () use ($originalDispatcher) { static::swap($originalDispatcher); Model::setE...
[ "public", "static", "function", "fakeFor", "(", "callable", "$", "callable", ",", "array", "$", "eventsToFake", "=", "[", "]", ")", "{", "$", "originalDispatcher", "=", "static", "::", "getFacadeRoot", "(", ")", ";", "static", "::", "fake", "(", "$", "ev...
Replace the bound instance with a fake during the given callable's execution. @param callable $callable @param array $eventsToFake @return callable
[ "Replace", "the", "bound", "instance", "with", "a", "fake", "during", "the", "given", "callable", "s", "execution", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Facades/Event.php#L45-L56
205,949
laravel/framework
src/Illuminate/Routing/ImplicitRouteBinding.php
ImplicitRouteBinding.resolveForRoute
public static function resolveForRoute($container, $route) { $parameters = $route->parameters(); foreach ($route->signatureParameters(UrlRoutable::class) as $parameter) { if (! $parameterName = static::getParameterName($parameter->name, $parameters)) { continue; ...
php
public static function resolveForRoute($container, $route) { $parameters = $route->parameters(); foreach ($route->signatureParameters(UrlRoutable::class) as $parameter) { if (! $parameterName = static::getParameterName($parameter->name, $parameters)) { continue; ...
[ "public", "static", "function", "resolveForRoute", "(", "$", "container", ",", "$", "route", ")", "{", "$", "parameters", "=", "$", "route", "->", "parameters", "(", ")", ";", "foreach", "(", "$", "route", "->", "signatureParameters", "(", "UrlRoutable", "...
Resolve the implicit route bindings for the given route. @param \Illuminate\Container\Container $container @param \Illuminate\Routing\Route $route @return void @throws \Illuminate\Database\Eloquent\ModelNotFoundException
[ "Resolve", "the", "implicit", "route", "bindings", "for", "the", "given", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ImplicitRouteBinding.php#L20-L43
205,950
laravel/framework
src/Illuminate/Routing/ImplicitRouteBinding.php
ImplicitRouteBinding.getParameterName
protected static function getParameterName($name, $parameters) { if (array_key_exists($name, $parameters)) { return $name; } if (array_key_exists($snakedName = Str::snake($name), $parameters)) { return $snakedName; } }
php
protected static function getParameterName($name, $parameters) { if (array_key_exists($name, $parameters)) { return $name; } if (array_key_exists($snakedName = Str::snake($name), $parameters)) { return $snakedName; } }
[ "protected", "static", "function", "getParameterName", "(", "$", "name", ",", "$", "parameters", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "parameters", ")", ")", "{", "return", "$", "name", ";", "}", "if", "(", "array_key_exis...
Return the parameter name if it exists in the given parameters. @param string $name @param array $parameters @return string|null
[ "Return", "the", "parameter", "name", "if", "it", "exists", "in", "the", "given", "parameters", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ImplicitRouteBinding.php#L52-L61
205,951
laravel/framework
src/Illuminate/Console/Application.php
Application.parseCommand
protected function parseCommand($command, $parameters) { if (is_subclass_of($command, SymfonyCommand::class)) { $callingClass = true; $command = $this->laravel->make($command)->getName(); } if (! isset($callingClass) && empty($parameters)) { $command = $...
php
protected function parseCommand($command, $parameters) { if (is_subclass_of($command, SymfonyCommand::class)) { $callingClass = true; $command = $this->laravel->make($command)->getName(); } if (! isset($callingClass) && empty($parameters)) { $command = $...
[ "protected", "function", "parseCommand", "(", "$", "command", ",", "$", "parameters", ")", "{", "if", "(", "is_subclass_of", "(", "$", "command", ",", "SymfonyCommand", "::", "class", ")", ")", "{", "$", "callingClass", "=", "true", ";", "$", "command", ...
Parse the incoming Artisan command and its input. @param string $command @param array $parameters @return array
[ "Parse", "the", "incoming", "Artisan", "command", "and", "its", "input", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Application.php#L193-L210
205,952
laravel/framework
src/Illuminate/Validation/Rules/Unique.php
Unique.ignore
public function ignore($id, $idColumn = null) { if ($id instanceof Model) { return $this->ignoreModel($id, $idColumn); } $this->ignore = $id; $this->idColumn = $idColumn ?? 'id'; return $this; }
php
public function ignore($id, $idColumn = null) { if ($id instanceof Model) { return $this->ignoreModel($id, $idColumn); } $this->ignore = $id; $this->idColumn = $idColumn ?? 'id'; return $this; }
[ "public", "function", "ignore", "(", "$", "id", ",", "$", "idColumn", "=", "null", ")", "{", "if", "(", "$", "id", "instanceof", "Model", ")", "{", "return", "$", "this", "->", "ignoreModel", "(", "$", "id", ",", "$", "idColumn", ")", ";", "}", "...
Ignore the given ID during the unique check. @param mixed $id @param string|null $idColumn @return $this
[ "Ignore", "the", "given", "ID", "during", "the", "unique", "check", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/Unique.php#L32-L42
205,953
laravel/framework
src/Illuminate/Validation/Rules/Unique.php
Unique.ignoreModel
public function ignoreModel($model, $idColumn = null) { $this->idColumn = $idColumn ?? $model->getKeyName(); $this->ignore = $model->{$this->idColumn}; return $this; }
php
public function ignoreModel($model, $idColumn = null) { $this->idColumn = $idColumn ?? $model->getKeyName(); $this->ignore = $model->{$this->idColumn}; return $this; }
[ "public", "function", "ignoreModel", "(", "$", "model", ",", "$", "idColumn", "=", "null", ")", "{", "$", "this", "->", "idColumn", "=", "$", "idColumn", "??", "$", "model", "->", "getKeyName", "(", ")", ";", "$", "this", "->", "ignore", "=", "$", ...
Ignore the given model during the unique check. @param \Illuminate\Database\Eloquent\Model $model @param string|null $idColumn @return $this
[ "Ignore", "the", "given", "model", "during", "the", "unique", "check", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/Unique.php#L51-L57
205,954
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.updateExistingPivotUsingCustomClass
protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch) { $updated = $this->newPivot([ $this->foreignPivotKey => $this->parent->{$this->parentKey}, $this->relatedPivotKey => $this->parseId($id), ], true)->fill($attributes)->save(); if (...
php
protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch) { $updated = $this->newPivot([ $this->foreignPivotKey => $this->parent->{$this->parentKey}, $this->relatedPivotKey => $this->parseId($id), ], true)->fill($attributes)->save(); if (...
[ "protected", "function", "updateExistingPivotUsingCustomClass", "(", "$", "id", ",", "array", "$", "attributes", ",", "$", "touch", ")", "{", "$", "updated", "=", "$", "this", "->", "newPivot", "(", "[", "$", "this", "->", "foreignPivotKey", "=>", "$", "th...
Update an existing pivot record on the table via a custom class. @param mixed $id @param array $attributes @param bool $touch @return int
[ "Update", "an", "existing", "pivot", "record", "on", "the", "table", "via", "a", "custom", "class", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L214-L226
205,955
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.attachUsingCustomClass
protected function attachUsingCustomClass($id, array $attributes) { $records = $this->formatAttachRecords( $this->parseIds($id), $attributes ); foreach ($records as $record) { $this->newPivot($record, false)->save(); } }
php
protected function attachUsingCustomClass($id, array $attributes) { $records = $this->formatAttachRecords( $this->parseIds($id), $attributes ); foreach ($records as $record) { $this->newPivot($record, false)->save(); } }
[ "protected", "function", "attachUsingCustomClass", "(", "$", "id", ",", "array", "$", "attributes", ")", "{", "$", "records", "=", "$", "this", "->", "formatAttachRecords", "(", "$", "this", "->", "parseIds", "(", "$", "id", ")", ",", "$", "attributes", ...
Attach a model to the parent using a custom class. @param mixed $id @param array $attributes @return void
[ "Attach", "a", "model", "to", "the", "parent", "using", "a", "custom", "class", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L261-L270
205,956
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.detachUsingCustomClass
protected function detachUsingCustomClass($ids) { $results = 0; foreach ($this->parseIds($ids) as $id) { $results += $this->newPivot([ $this->foreignPivotKey => $this->parent->{$this->parentKey}, $this->relatedPivotKey => $id, ], true)->delete...
php
protected function detachUsingCustomClass($ids) { $results = 0; foreach ($this->parseIds($ids) as $id) { $results += $this->newPivot([ $this->foreignPivotKey => $this->parent->{$this->parentKey}, $this->relatedPivotKey => $id, ], true)->delete...
[ "protected", "function", "detachUsingCustomClass", "(", "$", "ids", ")", "{", "$", "results", "=", "0", ";", "foreach", "(", "$", "this", "->", "parseIds", "(", "$", "ids", ")", "as", "$", "id", ")", "{", "$", "results", "+=", "$", "this", "->", "n...
Detach models from the relationship using a custom class. @param mixed $ids @return int
[ "Detach", "models", "from", "the", "relationship", "using", "a", "custom", "class", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L443-L455
205,957
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.withPivot
public function withPivot($columns) { $this->pivotColumns = array_merge( $this->pivotColumns, is_array($columns) ? $columns : func_get_args() ); return $this; }
php
public function withPivot($columns) { $this->pivotColumns = array_merge( $this->pivotColumns, is_array($columns) ? $columns : func_get_args() ); return $this; }
[ "public", "function", "withPivot", "(", "$", "columns", ")", "{", "$", "this", "->", "pivotColumns", "=", "array_merge", "(", "$", "this", "->", "pivotColumns", ",", "is_array", "(", "$", "columns", ")", "?", "$", "columns", ":", "func_get_args", "(", ")...
Set the columns on the pivot table to retrieve. @param array|mixed $columns @return $this
[ "Set", "the", "columns", "on", "the", "pivot", "table", "to", "retrieve", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L531-L538
205,958
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.castAttributes
protected function castAttributes($attributes) { return $this->using ? $this->newPivot()->fill($attributes)->getAttributes() : $attributes; }
php
protected function castAttributes($attributes) { return $this->using ? $this->newPivot()->fill($attributes)->getAttributes() : $attributes; }
[ "protected", "function", "castAttributes", "(", "$", "attributes", ")", "{", "return", "$", "this", "->", "using", "?", "$", "this", "->", "newPivot", "(", ")", "->", "fill", "(", "$", "attributes", ")", "->", "getAttributes", "(", ")", ":", "$", "attr...
Cast the given pivot attributes. @param array $attributes @return array
[ "Cast", "the", "given", "pivot", "attributes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L607-L612
205,959
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
InteractsWithPivotTable.getTypeSwapValue
protected function getTypeSwapValue($type, $value) { switch (strtolower($type)) { case 'int': case 'integer': return (int) $value; case 'real': case 'float': case 'double': return (float) $value; case 'st...
php
protected function getTypeSwapValue($type, $value) { switch (strtolower($type)) { case 'int': case 'integer': return (int) $value; case 'real': case 'float': case 'double': return (float) $value; case 'st...
[ "protected", "function", "getTypeSwapValue", "(", "$", "type", ",", "$", "value", ")", "{", "switch", "(", "strtolower", "(", "$", "type", ")", ")", "{", "case", "'int'", ":", "case", "'integer'", ":", "return", "(", "int", ")", "$", "value", ";", "c...
Converts a given value to a given type value. @param string $type @param mixed $value @return mixed
[ "Converts", "a", "given", "value", "to", "a", "given", "type", "value", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php#L621-L636
205,960
laravel/framework
src/Illuminate/Foundation/ProviderRepository.php
ProviderRepository.registerLoadEvents
protected function registerLoadEvents($provider, array $events) { if (count($events) < 1) { return; } $this->app->make('events')->listen($events, function () use ($provider) { $this->app->register($provider); }); }
php
protected function registerLoadEvents($provider, array $events) { if (count($events) < 1) { return; } $this->app->make('events')->listen($events, function () use ($provider) { $this->app->register($provider); }); }
[ "protected", "function", "registerLoadEvents", "(", "$", "provider", ",", "array", "$", "events", ")", "{", "if", "(", "count", "(", "$", "events", ")", "<", "1", ")", "{", "return", ";", "}", "$", "this", "->", "app", "->", "make", "(", "'events'", ...
Register the load events for the given provider. @param string $provider @param array $events @return void
[ "Register", "the", "load", "events", "for", "the", "given", "provider", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/ProviderRepository.php#L119-L128
205,961
laravel/framework
src/Illuminate/Validation/Rules/DatabaseRule.php
DatabaseRule.where
public function where($column, $value = null) { if (is_array($value)) { return $this->whereIn($column, $value); } if ($column instanceof Closure) { return $this->using($column); } $this->wheres[] = compact('column', 'value'); return $this; ...
php
public function where($column, $value = null) { if (is_array($value)) { return $this->whereIn($column, $value); } if ($column instanceof Closure) { return $this->using($column); } $this->wheres[] = compact('column', 'value'); return $this; ...
[ "public", "function", "where", "(", "$", "column", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "whereIn", "(", "$", "column", ",", "$", "value", ")", ";", "}", ...
Set a "where" constraint on the query. @param string|\Closure $column @param array|string|null $value @return $this
[ "Set", "a", "where", "constraint", "on", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/DatabaseRule.php#L57-L70
205,962
laravel/framework
src/Illuminate/Validation/Rules/DatabaseRule.php
DatabaseRule.whereNot
public function whereNot($column, $value) { if (is_array($value)) { return $this->whereNotIn($column, $value); } return $this->where($column, '!'.$value); }
php
public function whereNot($column, $value) { if (is_array($value)) { return $this->whereNotIn($column, $value); } return $this->where($column, '!'.$value); }
[ "public", "function", "whereNot", "(", "$", "column", ",", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "whereNotIn", "(", "$", "column", ",", "$", "value", ")", ";", "}", "return", ...
Set a "where not" constraint on the query. @param string $column @param array|string $value @return $this
[ "Set", "a", "where", "not", "constraint", "on", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/DatabaseRule.php#L79-L86
205,963
laravel/framework
src/Illuminate/Validation/Rules/DatabaseRule.php
DatabaseRule.whereIn
public function whereIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereIn($column, $values); }); }
php
public function whereIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereIn($column, $values); }); }
[ "public", "function", "whereIn", "(", "$", "column", ",", "array", "$", "values", ")", "{", "return", "$", "this", "->", "where", "(", "function", "(", "$", "query", ")", "use", "(", "$", "column", ",", "$", "values", ")", "{", "$", "query", "->", ...
Set a "where in" constraint on the query. @param string $column @param array $values @return $this
[ "Set", "a", "where", "in", "constraint", "on", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/DatabaseRule.php#L117-L122
205,964
laravel/framework
src/Illuminate/Validation/Rules/DatabaseRule.php
DatabaseRule.whereNotIn
public function whereNotIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereNotIn($column, $values); }); }
php
public function whereNotIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereNotIn($column, $values); }); }
[ "public", "function", "whereNotIn", "(", "$", "column", ",", "array", "$", "values", ")", "{", "return", "$", "this", "->", "where", "(", "function", "(", "$", "query", ")", "use", "(", "$", "column", ",", "$", "values", ")", "{", "$", "query", "->...
Set a "where not in" constraint on the query. @param string $column @param array $values @return $this
[ "Set", "a", "where", "not", "in", "constraint", "on", "the", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Validation/Rules/DatabaseRule.php#L131-L136
205,965
laravel/framework
src/Illuminate/Database/DatabaseManager.php
DatabaseManager.refreshPdoConnections
protected function refreshPdoConnections($name) { $fresh = $this->makeConnection($name); return $this->connections[$name] ->setPdo($fresh->getPdo()) ->setReadPdo($fresh->getReadPdo()); }
php
protected function refreshPdoConnections($name) { $fresh = $this->makeConnection($name); return $this->connections[$name] ->setPdo($fresh->getPdo()) ->setReadPdo($fresh->getReadPdo()); }
[ "protected", "function", "refreshPdoConnections", "(", "$", "name", ")", "{", "$", "fresh", "=", "$", "this", "->", "makeConnection", "(", "$", "name", ")", ";", "return", "$", "this", "->", "connections", "[", "$", "name", "]", "->", "setPdo", "(", "$...
Refresh the PDO connections on a given connection. @param string $name @return \Illuminate\Database\Connection
[ "Refresh", "the", "PDO", "connections", "on", "a", "given", "connection", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/DatabaseManager.php#L253-L260
205,966
laravel/framework
src/Illuminate/Http/Concerns/InteractsWithFlashData.php
InteractsWithFlashData.old
public function old($key = null, $default = null) { return $this->hasSession() ? $this->session()->getOldInput($key, $default) : $default; }
php
public function old($key = null, $default = null) { return $this->hasSession() ? $this->session()->getOldInput($key, $default) : $default; }
[ "public", "function", "old", "(", "$", "key", "=", "null", ",", "$", "default", "=", "null", ")", "{", "return", "$", "this", "->", "hasSession", "(", ")", "?", "$", "this", "->", "session", "(", ")", "->", "getOldInput", "(", "$", "key", ",", "$...
Retrieve an old input item. @param string $key @param string|array|null $default @return string|array
[ "Retrieve", "an", "old", "input", "item", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithFlashData.php#L14-L17
205,967
laravel/framework
src/Illuminate/Session/Middleware/AuthenticateSession.php
AuthenticateSession.storePasswordHashInSession
protected function storePasswordHashInSession($request) { if (! $request->user()) { return; } $request->session()->put([ 'password_hash' => $request->user()->getAuthPassword(), ]); }
php
protected function storePasswordHashInSession($request) { if (! $request->user()) { return; } $request->session()->put([ 'password_hash' => $request->user()->getAuthPassword(), ]); }
[ "protected", "function", "storePasswordHashInSession", "(", "$", "request", ")", "{", "if", "(", "!", "$", "request", "->", "user", "(", ")", ")", "{", "return", ";", "}", "$", "request", "->", "session", "(", ")", "->", "put", "(", "[", "'password_has...
Store the user's current password hash in the session. @param \Illuminate\Http\Request $request @return void
[ "Store", "the", "user", "s", "current", "password", "hash", "in", "the", "session", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Session/Middleware/AuthenticateSession.php#L69-L78
205,968
laravel/framework
src/Illuminate/Foundation/Console/RouteCacheCommand.php
RouteCacheCommand.buildRouteCacheFile
protected function buildRouteCacheFile(RouteCollection $routes) { $stub = $this->files->get(__DIR__.'/stubs/routes.stub'); return str_replace('{{routes}}', base64_encode(serialize($routes)), $stub); }
php
protected function buildRouteCacheFile(RouteCollection $routes) { $stub = $this->files->get(__DIR__.'/stubs/routes.stub'); return str_replace('{{routes}}', base64_encode(serialize($routes)), $stub); }
[ "protected", "function", "buildRouteCacheFile", "(", "RouteCollection", "$", "routes", ")", "{", "$", "stub", "=", "$", "this", "->", "files", "->", "get", "(", "__DIR__", ".", "'/stubs/routes.stub'", ")", ";", "return", "str_replace", "(", "'{{routes}}'", ","...
Build the route cache file. @param \Illuminate\Routing\RouteCollection $routes @return string
[ "Build", "the", "route", "cache", "file", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/RouteCacheCommand.php#L103-L108
205,969
laravel/framework
src/Illuminate/Http/Middleware/SetCacheHeaders.php
SetCacheHeaders.handle
public function handle($request, Closure $next, $options = []) { $response = $next($request); if (! $request->isMethodCacheable() || ! $response->getContent()) { return $response; } if (is_string($options)) { $options = $this->parseOptions($options); ...
php
public function handle($request, Closure $next, $options = []) { $response = $next($request); if (! $request->isMethodCacheable() || ! $response->getContent()) { return $response; } if (is_string($options)) { $options = $this->parseOptions($options); ...
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ",", "$", "options", "=", "[", "]", ")", "{", "$", "response", "=", "$", "next", "(", "$", "request", ")", ";", "if", "(", "!", "$", "request", "->", "isMethodCacheab...
Add cache related HTTP headers. @param \Illuminate\Http\Request $request @param \Closure $next @param string|array $options @return \Symfony\Component\HttpFoundation\Response @throws \InvalidArgumentException
[ "Add", "cache", "related", "HTTP", "headers", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Middleware/SetCacheHeaders.php#L19-L39
205,970
laravel/framework
src/Illuminate/Http/Middleware/SetCacheHeaders.php
SetCacheHeaders.parseOptions
protected function parseOptions($options) { return collect(explode(';', $options))->mapWithKeys(function ($option) { $data = explode('=', $option, 2); return [$data[0] => $data[1] ?? true]; })->all(); }
php
protected function parseOptions($options) { return collect(explode(';', $options))->mapWithKeys(function ($option) { $data = explode('=', $option, 2); return [$data[0] => $data[1] ?? true]; })->all(); }
[ "protected", "function", "parseOptions", "(", "$", "options", ")", "{", "return", "collect", "(", "explode", "(", "';'", ",", "$", "options", ")", ")", "->", "mapWithKeys", "(", "function", "(", "$", "option", ")", "{", "$", "data", "=", "explode", "("...
Parse the given header options. @param string $options @return array
[ "Parse", "the", "given", "header", "options", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Middleware/SetCacheHeaders.php#L47-L54
205,971
laravel/framework
src/Illuminate/Foundation/Console/Presets/None.php
None.updatePackageArray
protected static function updatePackageArray(array $packages) { unset( $packages['bootstrap'], $packages['jquery'], $packages['popper.js'], $packages['vue'], $packages['vue-template-compiler'], $packages['@babel/preset-react'], ...
php
protected static function updatePackageArray(array $packages) { unset( $packages['bootstrap'], $packages['jquery'], $packages['popper.js'], $packages['vue'], $packages['vue-template-compiler'], $packages['@babel/preset-react'], ...
[ "protected", "static", "function", "updatePackageArray", "(", "array", "$", "packages", ")", "{", "unset", "(", "$", "packages", "[", "'bootstrap'", "]", ",", "$", "packages", "[", "'jquery'", "]", ",", "$", "packages", "[", "'popper.js'", "]", ",", "$", ...
Update the given package array. @param array $packages @return array
[ "Update", "the", "given", "package", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/Presets/None.php#L34-L48
205,972
laravel/framework
src/Illuminate/Routing/Router.php
Router.redirect
public function redirect($uri, $destination, $status = 302) { return $this->any($uri, '\Illuminate\Routing\RedirectController') ->defaults('destination', $destination) ->defaults('status', $status); }
php
public function redirect($uri, $destination, $status = 302) { return $this->any($uri, '\Illuminate\Routing\RedirectController') ->defaults('destination', $destination) ->defaults('status', $status); }
[ "public", "function", "redirect", "(", "$", "uri", ",", "$", "destination", ",", "$", "status", "=", "302", ")", "{", "return", "$", "this", "->", "any", "(", "$", "uri", ",", "'\\Illuminate\\Routing\\RedirectController'", ")", "->", "defaults", "(", "'des...
Create a redirect from one URI to another. @param string $uri @param string $destination @param int $status @return \Illuminate\Routing\Route
[ "Create", "a", "redirect", "from", "one", "URI", "to", "another", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L242-L247
205,973
laravel/framework
src/Illuminate/Routing/Router.php
Router.view
public function view($uri, $view, $data = []) { return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController') ->defaults('view', $view) ->defaults('data', $data); }
php
public function view($uri, $view, $data = []) { return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController') ->defaults('view', $view) ->defaults('data', $data); }
[ "public", "function", "view", "(", "$", "uri", ",", "$", "view", ",", "$", "data", "=", "[", "]", ")", "{", "return", "$", "this", "->", "match", "(", "[", "'GET'", ",", "'HEAD'", "]", ",", "$", "uri", ",", "'\\Illuminate\\Routing\\ViewController'", ...
Register a new route that returns a view. @param string $uri @param string $view @param array $data @return \Illuminate\Routing\Route
[ "Register", "a", "new", "route", "that", "returns", "a", "view", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L269-L274
205,974
laravel/framework
src/Illuminate/Routing/Router.php
Router.apiResources
public function apiResources(array $resources, array $options = []) { foreach ($resources as $name => $controller) { $this->apiResource($name, $controller, $options); } }
php
public function apiResources(array $resources, array $options = []) { foreach ($resources as $name => $controller) { $this->apiResource($name, $controller, $options); } }
[ "public", "function", "apiResources", "(", "array", "$", "resources", ",", "array", "$", "options", "=", "[", "]", ")", "{", "foreach", "(", "$", "resources", "as", "$", "name", "=>", "$", "controller", ")", "{", "$", "this", "->", "apiResource", "(", ...
Register an array of API resource controllers. @param array $resources @param array $options @return void
[ "Register", "an", "array", "of", "API", "resource", "controllers", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L331-L336
205,975
laravel/framework
src/Illuminate/Routing/Router.php
Router.apiResource
public function apiResource($name, $controller, array $options = []) { $only = ['index', 'show', 'store', 'update', 'destroy']; if (isset($options['except'])) { $only = array_diff($only, (array) $options['except']); } return $this->resource($name, $controller, array_mer...
php
public function apiResource($name, $controller, array $options = []) { $only = ['index', 'show', 'store', 'update', 'destroy']; if (isset($options['except'])) { $only = array_diff($only, (array) $options['except']); } return $this->resource($name, $controller, array_mer...
[ "public", "function", "apiResource", "(", "$", "name", ",", "$", "controller", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "only", "=", "[", "'index'", ",", "'show'", ",", "'store'", ",", "'update'", ",", "'destroy'", "]", ";", "if", ...
Route an API resource to a controller. @param string $name @param string $controller @param array $options @return \Illuminate\Routing\PendingResourceRegistration
[ "Route", "an", "API", "resource", "to", "a", "controller", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L346-L357
205,976
laravel/framework
src/Illuminate/Routing/Router.php
Router.loadRoutes
protected function loadRoutes($routes) { if ($routes instanceof Closure) { $routes($this); } else { (new RouteFileRegistrar($this))->register($routes); } }
php
protected function loadRoutes($routes) { if ($routes instanceof Closure) { $routes($this); } else { (new RouteFileRegistrar($this))->register($routes); } }
[ "protected", "function", "loadRoutes", "(", "$", "routes", ")", "{", "if", "(", "$", "routes", "instanceof", "Closure", ")", "{", "$", "routes", "(", "$", "this", ")", ";", "}", "else", "{", "(", "new", "RouteFileRegistrar", "(", "$", "this", ")", ")...
Load the provided routes. @param \Closure|string $routes @return void
[ "Load", "the", "provided", "routes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L410-L417
205,977
laravel/framework
src/Illuminate/Routing/Router.php
Router.respondWithRoute
public function respondWithRoute($name) { $route = tap($this->routes->getByName($name))->bind($this->currentRequest); return $this->runRoute($this->currentRequest, $route); }
php
public function respondWithRoute($name) { $route = tap($this->routes->getByName($name))->bind($this->currentRequest); return $this->runRoute($this->currentRequest, $route); }
[ "public", "function", "respondWithRoute", "(", "$", "name", ")", "{", "$", "route", "=", "tap", "(", "$", "this", "->", "routes", "->", "getByName", "(", "$", "name", ")", ")", "->", "bind", "(", "$", "this", "->", "currentRequest", ")", ";", "return...
Return the response returned by the given route. @param string $name @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
[ "Return", "the", "response", "returned", "by", "the", "given", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L595-L600
205,978
laravel/framework
src/Illuminate/Routing/Router.php
Router.runRoute
protected function runRoute(Request $request, Route $route) { $request->setRouteResolver(function () use ($route) { return $route; }); $this->events->dispatch(new Events\RouteMatched($route, $request)); return $this->prepareResponse($request, $this->runRoute...
php
protected function runRoute(Request $request, Route $route) { $request->setRouteResolver(function () use ($route) { return $route; }); $this->events->dispatch(new Events\RouteMatched($route, $request)); return $this->prepareResponse($request, $this->runRoute...
[ "protected", "function", "runRoute", "(", "Request", "$", "request", ",", "Route", "$", "route", ")", "{", "$", "request", "->", "setRouteResolver", "(", "function", "(", ")", "use", "(", "$", "route", ")", "{", "return", "$", "route", ";", "}", ")", ...
Return the response for the given route. @param \Illuminate\Http\Request $request @param \Illuminate\Routing\Route $route @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
[ "Return", "the", "response", "for", "the", "given", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L648-L659
205,979
laravel/framework
src/Illuminate/Routing/Router.php
Router.gatherRouteMiddleware
public function gatherRouteMiddleware(Route $route) { $middleware = collect($route->gatherMiddleware())->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten(); return $this->sortMiddleware($middlew...
php
public function gatherRouteMiddleware(Route $route) { $middleware = collect($route->gatherMiddleware())->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten(); return $this->sortMiddleware($middlew...
[ "public", "function", "gatherRouteMiddleware", "(", "Route", "$", "route", ")", "{", "$", "middleware", "=", "collect", "(", "$", "route", "->", "gatherMiddleware", "(", ")", ")", "->", "map", "(", "function", "(", "$", "name", ")", "{", "return", "(", ...
Gather the middleware for the given route with resolved class names. @param \Illuminate\Routing\Route $route @return array
[ "Gather", "the", "middleware", "for", "the", "given", "route", "with", "resolved", "class", "names", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L691-L698
205,980
laravel/framework
src/Illuminate/Routing/Router.php
Router.prependMiddlewareToGroup
public function prependMiddlewareToGroup($group, $middleware) { if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) { array_unshift($this->middlewareGroups[$group], $middleware); } return $this; }
php
public function prependMiddlewareToGroup($group, $middleware) { if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) { array_unshift($this->middlewareGroups[$group], $middleware); } return $this; }
[ "public", "function", "prependMiddlewareToGroup", "(", "$", "group", ",", "$", "middleware", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "middlewareGroups", "[", "$", "group", "]", ")", "&&", "!", "in_array", "(", "$", "middleware", ",", "$", ...
Add a middleware to the beginning of a middleware group. If the middleware is already in the group, it will not be added again. @param string $group @param string $middleware @return $this
[ "Add", "a", "middleware", "to", "the", "beginning", "of", "a", "middleware", "group", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L884-L891
205,981
laravel/framework
src/Illuminate/Routing/Router.php
Router.getBindingCallback
public function getBindingCallback($key) { if (isset($this->binders[$key = str_replace('-', '_', $key)])) { return $this->binders[$key]; } }
php
public function getBindingCallback($key) { if (isset($this->binders[$key = str_replace('-', '_', $key)])) { return $this->binders[$key]; } }
[ "public", "function", "getBindingCallback", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "binders", "[", "$", "key", "=", "str_replace", "(", "'-'", ",", "'_'", ",", "$", "key", ")", "]", ")", ")", "{", "return", "$", "t...
Get the binding callback for a given binding. @param string $key @return \Closure|null
[ "Get", "the", "binding", "callback", "for", "a", "given", "binding", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L948-L953
205,982
laravel/framework
src/Illuminate/Routing/Router.php
Router.patterns
public function patterns($patterns) { foreach ($patterns as $key => $pattern) { $this->pattern($key, $pattern); } }
php
public function patterns($patterns) { foreach ($patterns as $key => $pattern) { $this->pattern($key, $pattern); } }
[ "public", "function", "patterns", "(", "$", "patterns", ")", "{", "foreach", "(", "$", "patterns", "as", "$", "key", "=>", "$", "pattern", ")", "{", "$", "this", "->", "pattern", "(", "$", "key", ",", "$", "pattern", ")", ";", "}", "}" ]
Set a group of global where patterns on all routes. @param array $patterns @return void
[ "Set", "a", "group", "of", "global", "where", "patterns", "on", "all", "routes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L983-L988
205,983
laravel/framework
src/Illuminate/Routing/Router.php
Router.has
public function has($name) { $names = is_array($name) ? $name : func_get_args(); foreach ($names as $value) { if (! $this->routes->hasNamedRoute($value)) { return false; } } return true; }
php
public function has($name) { $names = is_array($name) ? $name : func_get_args(); foreach ($names as $value) { if (! $this->routes->hasNamedRoute($value)) { return false; } } return true; }
[ "public", "function", "has", "(", "$", "name", ")", "{", "$", "names", "=", "is_array", "(", "$", "name", ")", "?", "$", "name", ":", "func_get_args", "(", ")", ";", "foreach", "(", "$", "names", "as", "$", "value", ")", "{", "if", "(", "!", "$...
Check if a route with the given name exists. @param string $name @return bool
[ "Check", "if", "a", "route", "with", "the", "given", "name", "exists", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L1058-L1069
205,984
laravel/framework
src/Illuminate/Routing/Router.php
Router.resetPassword
public function resetPassword() { $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); $this->get('password/reset/{token}', 'Auth...
php
public function resetPassword() { $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); $this->get('password/reset/{token}', 'Auth...
[ "public", "function", "resetPassword", "(", ")", "{", "$", "this", "->", "get", "(", "'password/reset'", ",", "'Auth\\ForgotPasswordController@showLinkRequestForm'", ")", "->", "name", "(", "'password.request'", ")", ";", "$", "this", "->", "post", "(", "'password...
Register the typical reset password routes for an application. @return void
[ "Register", "the", "typical", "reset", "password", "routes", "for", "an", "application", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L1178-L1184
205,985
laravel/framework
src/Illuminate/Routing/Router.php
Router.emailVerification
public function emailVerification() { $this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice'); $this->get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify'); $this->get('email/resend', 'Auth\VerificationController@resen...
php
public function emailVerification() { $this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice'); $this->get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify'); $this->get('email/resend', 'Auth\VerificationController@resen...
[ "public", "function", "emailVerification", "(", ")", "{", "$", "this", "->", "get", "(", "'email/verify'", ",", "'Auth\\VerificationController@show'", ")", "->", "name", "(", "'verification.notice'", ")", ";", "$", "this", "->", "get", "(", "'email/verify/{id}'", ...
Register the typical email verification routes for an application. @return void
[ "Register", "the", "typical", "email", "verification", "routes", "for", "an", "application", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Router.php#L1191-L1196
205,986
laravel/framework
src/Illuminate/Foundation/Console/RouteListCommand.php
RouteListCommand.sortRoutes
protected function sortRoutes($sort, array $routes) { return Arr::sort($routes, function ($route) use ($sort) { return $route[$sort]; }); }
php
protected function sortRoutes($sort, array $routes) { return Arr::sort($routes, function ($route) use ($sort) { return $route[$sort]; }); }
[ "protected", "function", "sortRoutes", "(", "$", "sort", ",", "array", "$", "routes", ")", "{", "return", "Arr", "::", "sort", "(", "$", "routes", ",", "function", "(", "$", "route", ")", "use", "(", "$", "sort", ")", "{", "return", "$", "route", "...
Sort the routes by a given element. @param string $sort @param array $routes @return array
[ "Sort", "the", "routes", "by", "a", "given", "element", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/RouteListCommand.php#L128-L133
205,987
laravel/framework
src/Illuminate/Foundation/Console/RouteListCommand.php
RouteListCommand.pluckColumns
protected function pluckColumns(array $routes) { return array_map(function ($route) { return Arr::only($route, $this->getColumns()); }, $routes); }
php
protected function pluckColumns(array $routes) { return array_map(function ($route) { return Arr::only($route, $this->getColumns()); }, $routes); }
[ "protected", "function", "pluckColumns", "(", "array", "$", "routes", ")", "{", "return", "array_map", "(", "function", "(", "$", "route", ")", "{", "return", "Arr", "::", "only", "(", "$", "route", ",", "$", "this", "->", "getColumns", "(", ")", ")", ...
Remove unnecessary columns from the routes. @param array $routes @return array
[ "Remove", "unnecessary", "columns", "from", "the", "routes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/RouteListCommand.php#L141-L146
205,988
laravel/framework
src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php
AsPivot.newQueryForCollectionRestoration
protected function newQueryForCollectionRestoration(array $ids) { if (! Str::contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } $query = $this->newQueryWithoutScopes(); foreach ($ids as $id) { $segments = explode(':', $id); ...
php
protected function newQueryForCollectionRestoration(array $ids) { if (! Str::contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } $query = $this->newQueryWithoutScopes(); foreach ($ids as $id) { $segments = explode(':', $id); ...
[ "protected", "function", "newQueryForCollectionRestoration", "(", "array", "$", "ids", ")", "{", "if", "(", "!", "Str", "::", "contains", "(", "$", "ids", "[", "0", "]", ",", "':'", ")", ")", "{", "return", "parent", "::", "newQueryForRestoration", "(", ...
Get a new query to restore multiple models by their queueable IDs. @param array|int $ids @return \Illuminate\Database\Eloquent\Builder
[ "Get", "a", "new", "query", "to", "restore", "multiple", "models", "by", "their", "queueable", "IDs", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php#L285-L303
205,989
laravel/framework
src/Illuminate/Queue/RedisQueue.php
RedisQueue.migrate
protected function migrate($queue) { $this->migrateExpiredJobs($queue.':delayed', $queue); if (! is_null($this->retryAfter)) { $this->migrateExpiredJobs($queue.':reserved', $queue); } }
php
protected function migrate($queue) { $this->migrateExpiredJobs($queue.':delayed', $queue); if (! is_null($this->retryAfter)) { $this->migrateExpiredJobs($queue.':reserved', $queue); } }
[ "protected", "function", "migrate", "(", "$", "queue", ")", "{", "$", "this", "->", "migrateExpiredJobs", "(", "$", "queue", ".", "':delayed'", ",", "$", "queue", ")", ";", "if", "(", "!", "is_null", "(", "$", "this", "->", "retryAfter", ")", ")", "{...
Migrate any delayed or expired jobs onto the primary queue. @param string $queue @return void
[ "Migrate", "any", "delayed", "or", "expired", "jobs", "onto", "the", "primary", "queue", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/RedisQueue.php#L189-L196
205,990
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.exists
public function exists(...$keys) { $keys = collect($keys)->map(function ($key) { return $this->applyPrefix($key); })->all(); return $this->executeRaw(array_merge(['exists'], $keys)); }
php
public function exists(...$keys) { $keys = collect($keys)->map(function ($key) { return $this->applyPrefix($key); })->all(); return $this->executeRaw(array_merge(['exists'], $keys)); }
[ "public", "function", "exists", "(", "...", "$", "keys", ")", "{", "$", "keys", "=", "collect", "(", "$", "keys", ")", "->", "map", "(", "function", "(", "$", "key", ")", "{", "return", "$", "this", "->", "applyPrefix", "(", "$", "key", ")", ";",...
Determine if the given keys exist. @param dynamic $keys @return int
[ "Determine", "if", "the", "given", "keys", "exist", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L57-L64
205,991
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.hmset
public function hmset($key, ...$dictionary) { if (count($dictionary) === 1) { $dictionary = $dictionary[0]; } else { $input = collect($dictionary); $dictionary = $input->nth(2)->combine($input->nth(2, 1))->toArray(); } return $this->command('hmse...
php
public function hmset($key, ...$dictionary) { if (count($dictionary) === 1) { $dictionary = $dictionary[0]; } else { $input = collect($dictionary); $dictionary = $input->nth(2)->combine($input->nth(2, 1))->toArray(); } return $this->command('hmse...
[ "public", "function", "hmset", "(", "$", "key", ",", "...", "$", "dictionary", ")", "{", "if", "(", "count", "(", "$", "dictionary", ")", "===", "1", ")", "{", "$", "dictionary", "=", "$", "dictionary", "[", "0", "]", ";", "}", "else", "{", "$", ...
Set the given hash fields to their respective values. @param string $key @param dynamic $dictionary @return int
[ "Set", "the", "given", "hash", "fields", "to", "their", "respective", "values", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L120-L131
205,992
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.blpop
public function blpop(...$arguments) { $result = $this->command('blpop', $arguments); return empty($result) ? null : $result; }
php
public function blpop(...$arguments) { $result = $this->command('blpop', $arguments); return empty($result) ? null : $result; }
[ "public", "function", "blpop", "(", "...", "$", "arguments", ")", "{", "$", "result", "=", "$", "this", "->", "command", "(", "'blpop'", ",", "$", "arguments", ")", ";", "return", "empty", "(", "$", "result", ")", "?", "null", ":", "$", "result", "...
Removes and returns the first element of the list stored at key. @param dynamic $arguments @return array|null
[ "Removes", "and", "returns", "the", "first", "element", "of", "the", "list", "stored", "at", "key", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L165-L170
205,993
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.brpop
public function brpop(...$arguments) { $result = $this->command('brpop', $arguments); return empty($result) ? null : $result; }
php
public function brpop(...$arguments) { $result = $this->command('brpop', $arguments); return empty($result) ? null : $result; }
[ "public", "function", "brpop", "(", "...", "$", "arguments", ")", "{", "$", "result", "=", "$", "this", "->", "command", "(", "'brpop'", ",", "$", "arguments", ")", ";", "return", "empty", "(", "$", "result", ")", "?", "null", ":", "$", "result", "...
Removes and returns the last element of the list stored at key. @param dynamic $arguments @return array|null
[ "Removes", "and", "returns", "the", "last", "element", "of", "the", "list", "stored", "at", "key", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L178-L183
205,994
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.pipeline
public function pipeline(callable $callback = null) { $pipeline = $this->client()->pipeline(); return is_null($callback) ? $pipeline : tap($pipeline, $callback)->exec(); }
php
public function pipeline(callable $callback = null) { $pipeline = $this->client()->pipeline(); return is_null($callback) ? $pipeline : tap($pipeline, $callback)->exec(); }
[ "public", "function", "pipeline", "(", "callable", "$", "callback", "=", "null", ")", "{", "$", "pipeline", "=", "$", "this", "->", "client", "(", ")", "->", "pipeline", "(", ")", ";", "return", "is_null", "(", "$", "callback", ")", "?", "$", "pipeli...
Execute commands in a pipeline. @param callable|null $callback @return \Redis|array
[ "Execute", "commands", "in", "a", "pipeline", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L298-L305
205,995
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.evalsha
public function evalsha($script, $numkeys, ...$arguments) { return $this->command('evalsha', [ $this->script('load', $script), $arguments, $numkeys, ]); }
php
public function evalsha($script, $numkeys, ...$arguments) { return $this->command('evalsha', [ $this->script('load', $script), $arguments, $numkeys, ]); }
[ "public", "function", "evalsha", "(", "$", "script", ",", "$", "numkeys", ",", "...", "$", "arguments", ")", "{", "return", "$", "this", "->", "command", "(", "'evalsha'", ",", "[", "$", "this", "->", "script", "(", "'load'", ",", "$", "script", ")",...
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @param string $script @param int $numkeys @param mixed $arguments @return mixed
[ "Evaluate", "a", "LUA", "script", "serverside", "from", "the", "SHA1", "hash", "of", "the", "script", "instead", "of", "the", "script", "itself", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L330-L335
205,996
laravel/framework
src/Illuminate/Redis/Connections/PhpRedisConnection.php
PhpRedisConnection.applyPrefix
private function applyPrefix($key) { $prefix = (string) $this->client->getOption(Redis::OPT_PREFIX); return $prefix.$key; }
php
private function applyPrefix($key) { $prefix = (string) $this->client->getOption(Redis::OPT_PREFIX); return $prefix.$key; }
[ "private", "function", "applyPrefix", "(", "$", "key", ")", "{", "$", "prefix", "=", "(", "string", ")", "$", "this", "->", "client", "->", "getOption", "(", "Redis", "::", "OPT_PREFIX", ")", ";", "return", "$", "prefix", ".", "$", "key", ";", "}" ]
Apply prefix to the given key if necessary. @param string $key @return string
[ "Apply", "prefix", "to", "the", "given", "key", "if", "necessary", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L418-L423
205,997
laravel/framework
src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
PostgresGrammar.compileSpatialIndex
public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) { $command->algorithm = 'gist'; return $this->compileIndex($blueprint, $command); }
php
public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) { $command->algorithm = 'gist'; return $this->compileIndex($blueprint, $command); }
[ "public", "function", "compileSpatialIndex", "(", "Blueprint", "$", "blueprint", ",", "Fluent", "$", "command", ")", "{", "$", "command", "->", "algorithm", "=", "'gist'", ";", "return", "$", "this", "->", "compileIndex", "(", "$", "blueprint", ",", "$", "...
Compile a spatial index key command. @param \Illuminate\Database\Schema\Blueprint $blueprint @param \Illuminate\Support\Fluent $command @return string
[ "Compile", "a", "spatial", "index", "key", "command", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L143-L148
205,998
laravel/framework
src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
PostgresGrammar.compileRename
public function compileRename(Blueprint $blueprint, Fluent $command) { $from = $this->wrapTable($blueprint); return "alter table {$from} rename to ".$this->wrapTable($command->to); }
php
public function compileRename(Blueprint $blueprint, Fluent $command) { $from = $this->wrapTable($blueprint); return "alter table {$from} rename to ".$this->wrapTable($command->to); }
[ "public", "function", "compileRename", "(", "Blueprint", "$", "blueprint", ",", "Fluent", "$", "command", ")", "{", "$", "from", "=", "$", "this", "->", "wrapTable", "(", "$", "blueprint", ")", ";", "return", "\"alter table {$from} rename to \"", ".", "$", "...
Compile a rename table command. @param \Illuminate\Database\Schema\Blueprint $blueprint @param \Illuminate\Support\Fluent $command @return string
[ "Compile", "a", "rename", "table", "command", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L331-L336
205,999
laravel/framework
src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
PostgresGrammar.compileComment
public function compileComment(Blueprint $blueprint, Fluent $command) { return sprintf('comment on column %s.%s is %s', $this->wrapTable($blueprint), $this->wrap($command->column->name), "'".str_replace("'", "''", $command->value)."'" ); }
php
public function compileComment(Blueprint $blueprint, Fluent $command) { return sprintf('comment on column %s.%s is %s', $this->wrapTable($blueprint), $this->wrap($command->column->name), "'".str_replace("'", "''", $command->value)."'" ); }
[ "public", "function", "compileComment", "(", "Blueprint", "$", "blueprint", ",", "Fluent", "$", "command", ")", "{", "return", "sprintf", "(", "'comment on column %s.%s is %s'", ",", "$", "this", "->", "wrapTable", "(", "$", "blueprint", ")", ",", "$", "this",...
Compile a comment command. @param \Illuminate\Database\Schema\Blueprint $blueprint @param \Illuminate\Support\Fluent $command @return string
[ "Compile", "a", "comment", "command", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L380-L387