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
206,200
laravel/framework
src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php
Broadcaster.retrieveChannelOptions
protected function retrieveChannelOptions($channel) { foreach ($this->channelOptions as $pattern => $options) { if (! $this->channelNameMatchesPattern($channel, $pattern)) { continue; } return $options; } return []; }
php
protected function retrieveChannelOptions($channel) { foreach ($this->channelOptions as $pattern => $options) { if (! $this->channelNameMatchesPattern($channel, $pattern)) { continue; } return $options; } return []; }
[ "protected", "function", "retrieveChannelOptions", "(", "$", "channel", ")", "{", "foreach", "(", "$", "this", "->", "channelOptions", "as", "$", "pattern", "=>", "$", "options", ")", "{", "if", "(", "!", "$", "this", "->", "channelNameMatchesPattern", "(", ...
Retrieve options for a certain channel. @param string $channel @return array
[ "Retrieve", "options", "for", "a", "certain", "channel", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php#L305-L316
206,201
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
HasEvents.fireCustomModelEvent
protected function fireCustomModelEvent($event, $method) { if (! isset($this->dispatchesEvents[$event])) { return; } $result = static::$dispatcher->$method(new $this->dispatchesEvents[$event]($this)); if (! is_null($result)) { return $result; } }
php
protected function fireCustomModelEvent($event, $method) { if (! isset($this->dispatchesEvents[$event])) { return; } $result = static::$dispatcher->$method(new $this->dispatchesEvents[$event]($this)); if (! is_null($result)) { return $result; } }
[ "protected", "function", "fireCustomModelEvent", "(", "$", "event", ",", "$", "method", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "dispatchesEvents", "[", "$", "event", "]", ")", ")", "{", "return", ";", "}", "$", "result", "=", "sta...
Fire a custom model event for the given event. @param string $event @param string $method @return mixed|null
[ "Fire", "a", "custom", "model", "event", "for", "the", "given", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php#L199-L210
206,202
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
HasEvents.filterModelEventResults
protected function filterModelEventResults($result) { if (is_array($result)) { $result = array_filter($result, function ($response) { return ! is_null($response); }); } return $result; }
php
protected function filterModelEventResults($result) { if (is_array($result)) { $result = array_filter($result, function ($response) { return ! is_null($response); }); } return $result; }
[ "protected", "function", "filterModelEventResults", "(", "$", "result", ")", "{", "if", "(", "is_array", "(", "$", "result", ")", ")", "{", "$", "result", "=", "array_filter", "(", "$", "result", ",", "function", "(", "$", "response", ")", "{", "return",...
Filter the model event results. @param mixed $result @return mixed
[ "Filter", "the", "model", "event", "results", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php#L218-L227
206,203
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
HasEvents.flushEventListeners
public static function flushEventListeners() { if (! isset(static::$dispatcher)) { return; } $instance = new static; foreach ($instance->getObservableEvents() as $event) { static::$dispatcher->forget("eloquent.{$event}: ".static::class); } f...
php
public static function flushEventListeners() { if (! isset(static::$dispatcher)) { return; } $instance = new static; foreach ($instance->getObservableEvents() as $event) { static::$dispatcher->forget("eloquent.{$event}: ".static::class); } f...
[ "public", "static", "function", "flushEventListeners", "(", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "dispatcher", ")", ")", "{", "return", ";", "}", "$", "instance", "=", "new", "static", ";", "foreach", "(", "$", "instance", "->",...
Remove all of the event listeners for the model. @return void
[ "Remove", "all", "of", "the", "event", "listeners", "for", "the", "model", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php#L344-L359
206,204
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.addDateAttributesToArray
protected function addDateAttributesToArray(array $attributes) { foreach ($this->getDates() as $key) { if (! isset($attributes[$key])) { continue; } $attributes[$key] = $this->serializeDate( $this->asDateTime($attributes[$key]) ...
php
protected function addDateAttributesToArray(array $attributes) { foreach ($this->getDates() as $key) { if (! isset($attributes[$key])) { continue; } $attributes[$key] = $this->serializeDate( $this->asDateTime($attributes[$key]) ...
[ "protected", "function", "addDateAttributesToArray", "(", "array", "$", "attributes", ")", "{", "foreach", "(", "$", "this", "->", "getDates", "(", ")", "as", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "attributes", "[", "$", "key", "]", ...
Add the date attributes to the attributes array. @param array $attributes @return array
[ "Add", "the", "date", "attributes", "to", "the", "attributes", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L123-L136
206,205
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.addMutatedAttributesToArray
protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) { foreach ($mutatedAttributes as $key) { // We want to spin through all the mutated attributes for this model and call // the mutator for the attribute. We cache off every mutated attributes s...
php
protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) { foreach ($mutatedAttributes as $key) { // We want to spin through all the mutated attributes for this model and call // the mutator for the attribute. We cache off every mutated attributes s...
[ "protected", "function", "addMutatedAttributesToArray", "(", "array", "$", "attributes", ",", "array", "$", "mutatedAttributes", ")", "{", "foreach", "(", "$", "mutatedAttributes", "as", "$", "key", ")", "{", "// We want to spin through all the mutated attributes for this...
Add the mutated attributes to the attributes array. @param array $attributes @param array $mutatedAttributes @return array
[ "Add", "the", "mutated", "attributes", "to", "the", "attributes", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L145-L164
206,206
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.getCastType
protected function getCastType($key) { if ($this->isCustomDateTimeCast($this->getCasts()[$key])) { return 'custom_datetime'; } if ($this->isDecimalCast($this->getCasts()[$key])) { return 'decimal'; } return trim(strtolower($this->getCasts()[$key])); ...
php
protected function getCastType($key) { if ($this->isCustomDateTimeCast($this->getCasts()[$key])) { return 'custom_datetime'; } if ($this->isDecimalCast($this->getCasts()[$key])) { return 'decimal'; } return trim(strtolower($this->getCasts()[$key])); ...
[ "protected", "function", "getCastType", "(", "$", "key", ")", "{", "if", "(", "$", "this", "->", "isCustomDateTimeCast", "(", "$", "this", "->", "getCasts", "(", ")", "[", "$", "key", "]", ")", ")", "{", "return", "'custom_datetime'", ";", "}", "if", ...
Get the type of cast for a model attribute. @param string $key @return string
[ "Get", "the", "type", "of", "cast", "for", "a", "model", "attribute", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L516-L527
206,207
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.fillJsonAttribute
public function fillJsonAttribute($key, $value) { [$key, $path] = explode('->', $key, 2); $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue( $path, $key, $value )); return $this; }
php
public function fillJsonAttribute($key, $value) { [$key, $path] = explode('->', $key, 2); $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue( $path, $key, $value )); return $this; }
[ "public", "function", "fillJsonAttribute", "(", "$", "key", ",", "$", "value", ")", "{", "[", "$", "key", ",", "$", "path", "]", "=", "explode", "(", "'->'", ",", "$", "key", ",", "2", ")", ";", "$", "this", "->", "attributes", "[", "$", "key", ...
Set a given JSON attribute on the model. @param string $key @param mixed $value @return $this
[ "Set", "a", "given", "JSON", "attribute", "on", "the", "model", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L633-L642
206,208
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.getArrayAttributeByKey
protected function getArrayAttributeByKey($key) { return isset($this->attributes[$key]) ? $this->fromJson($this->attributes[$key]) : []; }
php
protected function getArrayAttributeByKey($key) { return isset($this->attributes[$key]) ? $this->fromJson($this->attributes[$key]) : []; }
[ "protected", "function", "getArrayAttributeByKey", "(", "$", "key", ")", "{", "return", "isset", "(", "$", "this", "->", "attributes", "[", "$", "key", "]", ")", "?", "$", "this", "->", "fromJson", "(", "$", "this", "->", "attributes", "[", "$", "key",...
Get an array attribute or return an empty array if it is not set. @param string $key @return array
[ "Get", "an", "array", "attribute", "or", "return", "an", "empty", "array", "if", "it", "is", "not", "set", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L665-L669
206,209
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.only
public function only($attributes) { $results = []; foreach (is_array($attributes) ? $attributes : func_get_args() as $attribute) { $results[$attribute] = $this->getAttribute($attribute); } return $results; }
php
public function only($attributes) { $results = []; foreach (is_array($attributes) ? $attributes : func_get_args() as $attribute) { $results[$attribute] = $this->getAttribute($attribute); } return $results; }
[ "public", "function", "only", "(", "$", "attributes", ")", "{", "$", "results", "=", "[", "]", ";", "foreach", "(", "is_array", "(", "$", "attributes", ")", "?", "$", "attributes", ":", "func_get_args", "(", ")", "as", "$", "attribute", ")", "{", "$"...
Get a subset of the model's attributes. @param array|mixed $attributes @return array
[ "Get", "a", "subset", "of", "the", "model", "s", "attributes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L989-L998
206,210
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.syncOriginalAttributes
public function syncOriginalAttributes($attributes) { $attributes = is_array($attributes) ? $attributes : func_get_args(); foreach ($attributes as $attribute) { $this->original[$attribute] = $this->attributes[$attribute]; } return $this; }
php
public function syncOriginalAttributes($attributes) { $attributes = is_array($attributes) ? $attributes : func_get_args(); foreach ($attributes as $attribute) { $this->original[$attribute] = $this->attributes[$attribute]; } return $this; }
[ "public", "function", "syncOriginalAttributes", "(", "$", "attributes", ")", "{", "$", "attributes", "=", "is_array", "(", "$", "attributes", ")", "?", "$", "attributes", ":", "func_get_args", "(", ")", ";", "foreach", "(", "$", "attributes", "as", "$", "a...
Sync multiple original attribute with their current values. @param array|string $attributes @return $this
[ "Sync", "multiple", "original", "attribute", "with", "their", "current", "values", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L1029-L1038
206,211
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.hasChanges
protected function hasChanges($changes, $attributes = null) { // If no specific attributes were provided, we will just see if the dirty array // already contains any attributes. If it does we will just return that this // count is greater than zero. Else, we need to check specific attributes...
php
protected function hasChanges($changes, $attributes = null) { // If no specific attributes were provided, we will just see if the dirty array // already contains any attributes. If it does we will just return that this // count is greater than zero. Else, we need to check specific attributes...
[ "protected", "function", "hasChanges", "(", "$", "changes", ",", "$", "attributes", "=", "null", ")", "{", "// If no specific attributes were provided, we will just see if the dirty array", "// already contains any attributes. If it does we will just return that this", "// count is gre...
Determine if any of the given attributes were changed. @param array $changes @param array|string|null $attributes @return bool
[ "Determine", "if", "any", "of", "the", "given", "attributes", "were", "changed", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L1096-L1115
206,212
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
HasAttributes.append
public function append($attributes) { $this->appends = array_unique( array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes) ); return $this; }
php
public function append($attributes) { $this->appends = array_unique( array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes) ); return $this; }
[ "public", "function", "append", "(", "$", "attributes", ")", "{", "$", "this", "->", "appends", "=", "array_unique", "(", "array_merge", "(", "$", "this", "->", "appends", ",", "is_string", "(", "$", "attributes", ")", "?", "func_get_args", "(", ")", ":"...
Append attributes to query when building a query. @param array|string $attributes @return $this
[ "Append", "attributes", "to", "query", "when", "building", "a", "query", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L1182-L1189
206,213
laravel/framework
src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
PostgresGrammar.whereTime
protected function whereTime(Builder $query, $where) { $value = $this->parameter($where['value']); return $this->wrap($where['column']).'::time '.$where['operator'].' '.$value; }
php
protected function whereTime(Builder $query, $where) { $value = $this->parameter($where['value']); return $this->wrap($where['column']).'::time '.$where['operator'].' '.$value; }
[ "protected", "function", "whereTime", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "value", "=", "$", "this", "->", "parameter", "(", "$", "where", "[", "'value'", "]", ")", ";", "return", "$", "this", "->", "wrap", "(", "$", "wh...
Compile a "where time" clause. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "time", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php#L85-L90
206,214
laravel/framework
src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
PostgresGrammar.compileJsonUpdateColumn
protected function compileJsonUpdateColumn($key, $value) { $parts = explode('->', $key); $field = $this->wrap(array_shift($parts)); $path = '\'{"'.implode('","', $parts).'"}\''; return "{$field} = jsonb_set({$field}::jsonb, {$path}, {$this->parameter($value)})"; }
php
protected function compileJsonUpdateColumn($key, $value) { $parts = explode('->', $key); $field = $this->wrap(array_shift($parts)); $path = '\'{"'.implode('","', $parts).'"}\''; return "{$field} = jsonb_set({$field}::jsonb, {$path}, {$this->parameter($value)})"; }
[ "protected", "function", "compileJsonUpdateColumn", "(", "$", "key", ",", "$", "value", ")", "{", "$", "parts", "=", "explode", "(", "'->'", ",", "$", "key", ")", ";", "$", "field", "=", "$", "this", "->", "wrap", "(", "array_shift", "(", "$", "parts...
Prepares a JSON column being updated using the JSONB_SET function. @param string $key @param mixed $value @return string
[ "Prepares", "a", "JSON", "column", "being", "updated", "using", "the", "JSONB_SET", "function", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php#L268-L277
206,215
laravel/framework
src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
TransformsRequest.clean
protected function clean($request) { $this->cleanParameterBag($request->query); if ($request->isJson()) { $this->cleanParameterBag($request->json()); } elseif ($request->request !== $request->query) { $this->cleanParameterBag($request->request); } }
php
protected function clean($request) { $this->cleanParameterBag($request->query); if ($request->isJson()) { $this->cleanParameterBag($request->json()); } elseif ($request->request !== $request->query) { $this->cleanParameterBag($request->request); } }
[ "protected", "function", "clean", "(", "$", "request", ")", "{", "$", "this", "->", "cleanParameterBag", "(", "$", "request", "->", "query", ")", ";", "if", "(", "$", "request", "->", "isJson", "(", ")", ")", "{", "$", "this", "->", "cleanParameterBag"...
Clean the request's data. @param \Illuminate\Http\Request $request @return void
[ "Clean", "the", "request", "s", "data", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php#L30-L39
206,216
laravel/framework
src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
TransformsRequest.cleanArray
protected function cleanArray(array $data, $keyPrefix = '') { return collect($data)->map(function ($value, $key) use ($keyPrefix) { return $this->cleanValue($keyPrefix.$key, $value); })->all(); }
php
protected function cleanArray(array $data, $keyPrefix = '') { return collect($data)->map(function ($value, $key) use ($keyPrefix) { return $this->cleanValue($keyPrefix.$key, $value); })->all(); }
[ "protected", "function", "cleanArray", "(", "array", "$", "data", ",", "$", "keyPrefix", "=", "''", ")", "{", "return", "collect", "(", "$", "data", ")", "->", "map", "(", "function", "(", "$", "value", ",", "$", "key", ")", "use", "(", "$", "keyPr...
Clean the data in the given array. @param array $data @param string $keyPrefix @return array
[ "Clean", "the", "data", "in", "the", "given", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php#L59-L64
206,217
laravel/framework
src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php
UsePusherChannelConventions.normalizeChannelName
public function normalizeChannelName($channel) { if ($this->isGuardedChannel($channel)) { return Str::startsWith($channel, 'private-') ? Str::replaceFirst('private-', '', $channel) : Str::replaceFirst('presence-', '', $channel); } return $channel;...
php
public function normalizeChannelName($channel) { if ($this->isGuardedChannel($channel)) { return Str::startsWith($channel, 'private-') ? Str::replaceFirst('private-', '', $channel) : Str::replaceFirst('presence-', '', $channel); } return $channel;...
[ "public", "function", "normalizeChannelName", "(", "$", "channel", ")", "{", "if", "(", "$", "this", "->", "isGuardedChannel", "(", "$", "channel", ")", ")", "{", "return", "Str", "::", "startsWith", "(", "$", "channel", ",", "'private-'", ")", "?", "Str...
Remove prefix from channel name. @param string $channel @return string
[ "Remove", "prefix", "from", "channel", "name", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php#L26-L35
206,218
laravel/framework
src/Illuminate/Routing/ResponseFactory.php
ResponseFactory.json
public function json($data = [], $status = 200, array $headers = [], $options = 0) { return new JsonResponse($data, $status, $headers, $options); }
php
public function json($data = [], $status = 200, array $headers = [], $options = 0) { return new JsonResponse($data, $status, $headers, $options); }
[ "public", "function", "json", "(", "$", "data", "=", "[", "]", ",", "$", "status", "=", "200", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "options", "=", "0", ")", "{", "return", "new", "JsonResponse", "(", "$", "data", ",", "$", "s...
Create a new JSON response instance. @param mixed $data @param int $status @param array $headers @param int $options @return \Illuminate\Http\JsonResponse
[ "Create", "a", "new", "JSON", "response", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResponseFactory.php#L93-L96
206,219
laravel/framework
src/Illuminate/Routing/ResponseFactory.php
ResponseFactory.jsonp
public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0) { return $this->json($data, $status, $headers, $options)->setCallback($callback); }
php
public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0) { return $this->json($data, $status, $headers, $options)->setCallback($callback); }
[ "public", "function", "jsonp", "(", "$", "callback", ",", "$", "data", "=", "[", "]", ",", "$", "status", "=", "200", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "options", "=", "0", ")", "{", "return", "$", "this", "->", "json", "("...
Create a new JSONP response instance. @param string $callback @param mixed $data @param int $status @param array $headers @param int $options @return \Illuminate\Http\JsonResponse
[ "Create", "a", "new", "JSONP", "response", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResponseFactory.php#L108-L111
206,220
laravel/framework
src/Illuminate/Routing/ResponseFactory.php
ResponseFactory.streamDownload
public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment') { $response = new StreamedResponse($callback, 200, $headers); if (! is_null($name)) { $response->headers->set('Content-Disposition', $response->headers->makeDisposition( ...
php
public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment') { $response = new StreamedResponse($callback, 200, $headers); if (! is_null($name)) { $response->headers->set('Content-Disposition', $response->headers->makeDisposition( ...
[ "public", "function", "streamDownload", "(", "$", "callback", ",", "$", "name", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "disposition", "=", "'attachment'", ")", "{", "$", "response", "=", "new", "StreamedResponse", "(", "$", ...
Create a new streamed response instance as a file download. @param \Closure $callback @param string|null $name @param array $headers @param string|null $disposition @return \Symfony\Component\HttpFoundation\StreamedResponse
[ "Create", "a", "new", "streamed", "response", "instance", "as", "a", "file", "download", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/ResponseFactory.php#L135-L148
206,221
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newHasOne
protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) { return new HasOne($query, $parent, $foreignKey, $localKey); }
php
protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) { return new HasOne($query, $parent, $foreignKey, $localKey); }
[ "protected", "function", "newHasOne", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "foreignKey", ",", "$", "localKey", ")", "{", "return", "new", "HasOne", "(", "$", "query", ",", "$", "parent", ",", "$", "foreignKey", ",", "$",...
Instantiate a new HasOne relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $foreignKey @param string $localKey @return \Illuminate\Database\Eloquent\Relations\HasOne
[ "Instantiate", "a", "new", "HasOne", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L75-L78
206,222
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newHasOneThrough
protected function newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { return new HasOneThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); }
php
protected function newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { return new HasOneThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); }
[ "protected", "function", "newHasOneThrough", "(", "Builder", "$", "query", ",", "Model", "$", "farParent", ",", "Model", "$", "throughParent", ",", "$", "firstKey", ",", "$", "secondKey", ",", "$", "localKey", ",", "$", "secondLocalKey", ")", "{", "return", ...
Instantiate a new HasOneThrough relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $farParent @param \Illuminate\Database\Eloquent\Model $throughParent @param string $firstKey @param string $secondKey @param string $localKey @param string $secondL...
[ "Instantiate", "a", "new", "HasOneThrough", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L118-L121
206,223
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newMorphOne
protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) { return new MorphOne($query, $parent, $type, $id, $localKey); }
php
protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) { return new MorphOne($query, $parent, $type, $id, $localKey); }
[ "protected", "function", "newMorphOne", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "type", ",", "$", "id", ",", "$", "localKey", ")", "{", "return", "new", "MorphOne", "(", "$", "query", ",", "$", "parent", ",", "$", "type",...
Instantiate a new MorphOne relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $type @param string $id @param string $localKey @return \Illuminate\Database\Eloquent\Relations\MorphOne
[ "Instantiate", "a", "new", "MorphOne", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L156-L159
206,224
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newMorphTo
protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) { return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation); }
php
protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) { return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation); }
[ "protected", "function", "newMorphTo", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "foreignKey", ",", "$", "ownerKey", ",", "$", "type", ",", "$", "relation", ")", "{", "return", "new", "MorphTo", "(", "$", "query", ",", "$", ...
Instantiate a new MorphTo relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $foreignKey @param string $ownerKey @param string $type @param string $relation @return \Illuminate\Database\Eloquent\Relations\MorphTo
[ "Instantiate", "a", "new", "MorphTo", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L289-L292
206,225
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newHasMany
protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) { return new HasMany($query, $parent, $foreignKey, $localKey); }
php
protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) { return new HasMany($query, $parent, $foreignKey, $localKey); }
[ "protected", "function", "newHasMany", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "foreignKey", ",", "$", "localKey", ")", "{", "return", "new", "HasMany", "(", "$", "query", ",", "$", "parent", ",", "$", "foreignKey", ",", "$...
Instantiate a new HasMany relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $foreignKey @param string $localKey @return \Illuminate\Database\Eloquent\Relations\HasMany
[ "Instantiate", "a", "new", "HasMany", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L347-L350
206,226
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newHasManyThrough
protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); }
php
protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); }
[ "protected", "function", "newHasManyThrough", "(", "Builder", "$", "query", ",", "Model", "$", "farParent", ",", "Model", "$", "throughParent", ",", "$", "firstKey", ",", "$", "secondKey", ",", "$", "localKey", ",", "$", "secondLocalKey", ")", "{", "return",...
Instantiate a new HasManyThrough relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $farParent @param \Illuminate\Database\Eloquent\Model $throughParent @param string $firstKey @param string $secondKey @param string $localKey @param string $second...
[ "Instantiate", "a", "new", "HasManyThrough", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L390-L393
206,227
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newMorphMany
protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) { return new MorphMany($query, $parent, $type, $id, $localKey); }
php
protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) { return new MorphMany($query, $parent, $type, $id, $localKey); }
[ "protected", "function", "newMorphMany", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "type", ",", "$", "id", ",", "$", "localKey", ")", "{", "return", "new", "MorphMany", "(", "$", "query", ",", "$", "parent", ",", "$", "type...
Instantiate a new MorphMany relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $type @param string $id @param string $localKey @return \Illuminate\Database\Eloquent\Relations\MorphMany
[ "Instantiate", "a", "new", "MorphMany", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L431-L434
206,228
laravel/framework
src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php
HasRelationships.newMorphToMany
protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null, $inverse = false) { return new MorphToMany($query, $parent, $name, $t...
php
protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null, $inverse = false) { return new MorphToMany($query, $parent, $name, $t...
[ "protected", "function", "newMorphToMany", "(", "Builder", "$", "query", ",", "Model", "$", "parent", ",", "$", "name", ",", "$", "table", ",", "$", "foreignPivotKey", ",", "$", "relatedPivotKey", ",", "$", "parentKey", ",", "$", "relatedKey", ",", "$", ...
Instantiate a new MorphToMany relationship. @param \Illuminate\Database\Eloquent\Builder $query @param \Illuminate\Database\Eloquent\Model $parent @param string $name @param string $table @param string $foreignPivotKey @param string $relatedPivotKey @param string $parentKey @param string $relatedKey @p...
[ "Instantiate", "a", "new", "MorphToMany", "relationship", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php#L561-L567
206,229
laravel/framework
src/Illuminate/Database/ConfigurationUrlParser.php
ConfigurationUrlParser.parseConfiguration
public function parseConfiguration($config) { if (is_string($config)) { $config = ['url' => $config]; } $url = $config['url'] ?? null; $config = Arr::except($config, 'url'); if (! $url) { return $config; } $parsedUrl = $this->parseU...
php
public function parseConfiguration($config) { if (is_string($config)) { $config = ['url' => $config]; } $url = $config['url'] ?? null; $config = Arr::except($config, 'url'); if (! $url) { return $config; } $parsedUrl = $this->parseU...
[ "public", "function", "parseConfiguration", "(", "$", "config", ")", "{", "if", "(", "is_string", "(", "$", "config", ")", ")", "{", "$", "config", "=", "[", "'url'", "=>", "$", "config", "]", ";", "}", "$", "url", "=", "$", "config", "[", "'url'",...
Parse the database configuration, hydrating options using a database configuration URL if possible. @param array|string $config @return array
[ "Parse", "the", "database", "configuration", "hydrating", "options", "using", "a", "database", "configuration", "URL", "if", "possible", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/ConfigurationUrlParser.php#L29-L50
206,230
laravel/framework
src/Illuminate/Database/ConfigurationUrlParser.php
ConfigurationUrlParser.getPrimaryOptions
protected function getPrimaryOptions($url) { return array_filter([ 'driver' => $this->getDriver($url), 'database' => $this->getDatabase($url), 'host' => $url['host'] ?? null, 'port' => $url['port'] ?? null, 'username' => $url['user'] ?? null, ...
php
protected function getPrimaryOptions($url) { return array_filter([ 'driver' => $this->getDriver($url), 'database' => $this->getDatabase($url), 'host' => $url['host'] ?? null, 'port' => $url['port'] ?? null, 'username' => $url['user'] ?? null, ...
[ "protected", "function", "getPrimaryOptions", "(", "$", "url", ")", "{", "return", "array_filter", "(", "[", "'driver'", "=>", "$", "this", "->", "getDriver", "(", "$", "url", ")", ",", "'database'", "=>", "$", "this", "->", "getDatabase", "(", "$", "url...
Get the primary database connection options. @param array $url @return array
[ "Get", "the", "primary", "database", "connection", "options", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/ConfigurationUrlParser.php#L58-L70
206,231
laravel/framework
src/Illuminate/Database/ConfigurationUrlParser.php
ConfigurationUrlParser.getQueryOptions
protected function getQueryOptions($url) { $queryString = $url['query'] ?? null; if (! $queryString) { return []; } $query = []; parse_str($queryString, $query); return $this->parseStringsToNativeTypes($query); }
php
protected function getQueryOptions($url) { $queryString = $url['query'] ?? null; if (! $queryString) { return []; } $query = []; parse_str($queryString, $query); return $this->parseStringsToNativeTypes($query); }
[ "protected", "function", "getQueryOptions", "(", "$", "url", ")", "{", "$", "queryString", "=", "$", "url", "[", "'query'", "]", "??", "null", ";", "if", "(", "!", "$", "queryString", ")", "{", "return", "[", "]", ";", "}", "$", "query", "=", "[", ...
Get all of the additional database options from the query string. @param array $url @return array
[ "Get", "all", "of", "the", "additional", "database", "options", "from", "the", "query", "string", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/ConfigurationUrlParser.php#L108-L121
206,232
laravel/framework
src/Illuminate/Database/ConfigurationUrlParser.php
ConfigurationUrlParser.parseUrl
protected function parseUrl($url) { $url = preg_replace('#^(sqlite3?):///#', '$1://null/', $url); $parsedUrl = parse_url($url); if ($parsedUrl === false) { throw new InvalidArgumentException('The database configuration URL is malformed.'); } return $this->parse...
php
protected function parseUrl($url) { $url = preg_replace('#^(sqlite3?):///#', '$1://null/', $url); $parsedUrl = parse_url($url); if ($parsedUrl === false) { throw new InvalidArgumentException('The database configuration URL is malformed.'); } return $this->parse...
[ "protected", "function", "parseUrl", "(", "$", "url", ")", "{", "$", "url", "=", "preg_replace", "(", "'#^(sqlite3?):///#'", ",", "'$1://null/'", ",", "$", "url", ")", ";", "$", "parsedUrl", "=", "parse_url", "(", "$", "url", ")", ";", "if", "(", "$", ...
Parse the string URL to an array of components. @param string $url @return array
[ "Parse", "the", "string", "URL", "to", "an", "array", "of", "components", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/ConfigurationUrlParser.php#L129-L142
206,233
laravel/framework
src/Illuminate/Database/ConfigurationUrlParser.php
ConfigurationUrlParser.parseStringsToNativeTypes
protected function parseStringsToNativeTypes($value) { if (is_array($value)) { return array_map([$this, 'parseStringsToNativeTypes'], $value); } if (! is_string($value)) { return $value; } $parsedValue = json_decode($value, true); if (json_l...
php
protected function parseStringsToNativeTypes($value) { if (is_array($value)) { return array_map([$this, 'parseStringsToNativeTypes'], $value); } if (! is_string($value)) { return $value; } $parsedValue = json_decode($value, true); if (json_l...
[ "protected", "function", "parseStringsToNativeTypes", "(", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "return", "array_map", "(", "[", "$", "this", ",", "'parseStringsToNativeTypes'", "]", ",", "$", "value", ")", ";", ...
Convert string casted values to their native types. @param mixed $value @return mixed
[ "Convert", "string", "casted", "values", "to", "their", "native", "types", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/ConfigurationUrlParser.php#L150-L167
206,234
laravel/framework
src/Illuminate/Foundation/Bootstrap/HandleExceptions.php
HandleExceptions.fatalExceptionFromError
protected function fatalExceptionFromError(array $error, $traceOffset = null) { return new FatalErrorException( $error['message'], $error['type'], 0, $error['file'], $error['line'], $traceOffset ); }
php
protected function fatalExceptionFromError(array $error, $traceOffset = null) { return new FatalErrorException( $error['message'], $error['type'], 0, $error['file'], $error['line'], $traceOffset ); }
[ "protected", "function", "fatalExceptionFromError", "(", "array", "$", "error", ",", "$", "traceOffset", "=", "null", ")", "{", "return", "new", "FatalErrorException", "(", "$", "error", "[", "'message'", "]", ",", "$", "error", "[", "'type'", "]", ",", "0...
Create a new fatal exception instance from an error array. @param array $error @param int|null $traceOffset @return \Symfony\Component\Debug\Exception\FatalErrorException
[ "Create", "a", "new", "fatal", "exception", "instance", "from", "an", "error", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php#L134-L139
206,235
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.compileAggregate
protected function compileAggregate(Builder $query, $aggregate) { $column = $this->columnize($aggregate['columns']); // If the query has a "distinct" constraint and we're not asking for all columns // we need to prepend "distinct" onto the column name so that the query takes // it i...
php
protected function compileAggregate(Builder $query, $aggregate) { $column = $this->columnize($aggregate['columns']); // If the query has a "distinct" constraint and we're not asking for all columns // we need to prepend "distinct" onto the column name so that the query takes // it i...
[ "protected", "function", "compileAggregate", "(", "Builder", "$", "query", ",", "$", "aggregate", ")", "{", "$", "column", "=", "$", "this", "->", "columnize", "(", "$", "aggregate", "[", "'columns'", "]", ")", ";", "// If the query has a \"distinct\" constraint...
Compile an aggregated select clause. @param \Illuminate\Database\Query\Builder $query @param array $aggregate @return string
[ "Compile", "an", "aggregated", "select", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L105-L117
206,236
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.concatenateWhereClauses
protected function concatenateWhereClauses($query, $sql) { $conjunction = $query instanceof JoinClause ? 'on' : 'where'; return $conjunction.' '.$this->removeLeadingBoolean(implode(' ', $sql)); }
php
protected function concatenateWhereClauses($query, $sql) { $conjunction = $query instanceof JoinClause ? 'on' : 'where'; return $conjunction.' '.$this->removeLeadingBoolean(implode(' ', $sql)); }
[ "protected", "function", "concatenateWhereClauses", "(", "$", "query", ",", "$", "sql", ")", "{", "$", "conjunction", "=", "$", "query", "instanceof", "JoinClause", "?", "'on'", ":", "'where'", ";", "return", "$", "conjunction", ".", "' '", ".", "$", "this...
Format the where clause statements into one string. @param \Illuminate\Database\Query\Builder $query @param array $sql @return string
[ "Format", "the", "where", "clause", "statements", "into", "one", "string", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L217-L222
206,237
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereNotInRaw
protected function whereNotInRaw(Builder $query, $where) { if (! empty($where['values'])) { return $this->wrap($where['column']).' not in ('.implode(', ', $where['values']).')'; } return '1 = 1'; }
php
protected function whereNotInRaw(Builder $query, $where) { if (! empty($where['values'])) { return $this->wrap($where['column']).' not in ('.implode(', ', $where['values']).')'; } return '1 = 1'; }
[ "protected", "function", "whereNotInRaw", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "if", "(", "!", "empty", "(", "$", "where", "[", "'values'", "]", ")", ")", "{", "return", "$", "this", "->", "wrap", "(", "$", "where", "[", "'col...
Compile a "where not in raw" clause. For safety, whereIntegerInRaw ensures this method is only used with integer values. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "not", "in", "raw", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L291-L298
206,238
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereNotInSub
protected function whereNotInSub(Builder $query, $where) { return $this->wrap($where['column']).' not in ('.$this->compileSelect($where['query']).')'; }
php
protected function whereNotInSub(Builder $query, $where) { return $this->wrap($where['column']).' not in ('.$this->compileSelect($where['query']).')'; }
[ "protected", "function", "whereNotInSub", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "return", "$", "this", "->", "wrap", "(", "$", "where", "[", "'column'", "]", ")", ".", "' not in ('", ".", "$", "this", "->", "compileSelect", "(", "$...
Compile a where not in sub-select clause. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "not", "in", "sub", "-", "select", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L319-L322
206,239
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereInRaw
protected function whereInRaw(Builder $query, $where) { if (! empty($where['values'])) { return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')'; } return '0 = 1'; }
php
protected function whereInRaw(Builder $query, $where) { if (! empty($where['values'])) { return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')'; } return '0 = 1'; }
[ "protected", "function", "whereInRaw", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "if", "(", "!", "empty", "(", "$", "where", "[", "'values'", "]", ")", ")", "{", "return", "$", "this", "->", "wrap", "(", "$", "where", "[", "'column...
Compile a "where in raw" clause. For safety, whereIntegerInRaw ensures this method is only used with integer values. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "in", "raw", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L333-L340
206,240
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereColumn
protected function whereColumn(Builder $query, $where) { return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); }
php
protected function whereColumn(Builder $query, $where) { return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); }
[ "protected", "function", "whereColumn", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "return", "$", "this", "->", "wrap", "(", "$", "where", "[", "'first'", "]", ")", ".", "' '", ".", "$", "where", "[", "'operator'", "]", ".", "' '", ...
Compile a where clause comparing two columns.. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "clause", "comparing", "two", "columns", ".." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L466-L469
206,241
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereSub
protected function whereSub(Builder $query, $where) { $select = $this->compileSelect($where['query']); return $this->wrap($where['column']).' '.$where['operator']." ($select)"; }
php
protected function whereSub(Builder $query, $where) { $select = $this->compileSelect($where['query']); return $this->wrap($where['column']).' '.$where['operator']." ($select)"; }
[ "protected", "function", "whereSub", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "select", "=", "$", "this", "->", "compileSelect", "(", "$", "where", "[", "'query'", "]", ")", ";", "return", "$", "this", "->", "wrap", "(", "$", ...
Compile a where condition with a sub-select. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "condition", "with", "a", "sub", "-", "select", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L495-L500
206,242
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereRowValues
protected function whereRowValues(Builder $query, $where) { $columns = $this->columnize($where['columns']); $values = $this->parameterize($where['values']); return '('.$columns.') '.$where['operator'].' ('.$values.')'; }
php
protected function whereRowValues(Builder $query, $where) { $columns = $this->columnize($where['columns']); $values = $this->parameterize($where['values']); return '('.$columns.') '.$where['operator'].' ('.$values.')'; }
[ "protected", "function", "whereRowValues", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "columns", "=", "$", "this", "->", "columnize", "(", "$", "where", "[", "'columns'", "]", ")", ";", "$", "values", "=", "$", "this", "->", "par...
Compile a where row values condition. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "row", "values", "condition", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L533-L540
206,243
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereJsonBoolean
protected function whereJsonBoolean(Builder $query, $where) { $column = $this->wrapJsonBooleanSelector($where['column']); $value = $this->wrapJsonBooleanValue( $this->parameter($where['value']) ); return $column.' '.$where['operator'].' '.$value; }
php
protected function whereJsonBoolean(Builder $query, $where) { $column = $this->wrapJsonBooleanSelector($where['column']); $value = $this->wrapJsonBooleanValue( $this->parameter($where['value']) ); return $column.' '.$where['operator'].' '.$value; }
[ "protected", "function", "whereJsonBoolean", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "column", "=", "$", "this", "->", "wrapJsonBooleanSelector", "(", "$", "where", "[", "'column'", "]", ")", ";", "$", "value", "=", "$", "this", ...
Compile a "where JSON boolean" clause. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "JSON", "boolean", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L549-L558
206,244
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereJsonContains
protected function whereJsonContains(Builder $query, $where) { $not = $where['not'] ? 'not ' : ''; return $not.$this->compileJsonContains( $where['column'], $this->parameter($where['value']) ); }
php
protected function whereJsonContains(Builder $query, $where) { $not = $where['not'] ? 'not ' : ''; return $not.$this->compileJsonContains( $where['column'], $this->parameter($where['value']) ); }
[ "protected", "function", "whereJsonContains", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "not", "=", "$", "where", "[", "'not'", "]", "?", "'not '", ":", "''", ";", "return", "$", "not", ".", "$", "this", "->", "compileJsonContains...
Compile a "where JSON contains" clause. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "JSON", "contains", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L567-L574
206,245
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.whereJsonLength
protected function whereJsonLength(Builder $query, $where) { return $this->compileJsonLength( $where['column'], $where['operator'], $this->parameter($where['value']) ); }
php
protected function whereJsonLength(Builder $query, $where) { return $this->compileJsonLength( $where['column'], $where['operator'], $this->parameter($where['value']) ); }
[ "protected", "function", "whereJsonLength", "(", "Builder", "$", "query", ",", "$", "where", ")", "{", "return", "$", "this", "->", "compileJsonLength", "(", "$", "where", "[", "'column'", "]", ",", "$", "where", "[", "'operator'", "]", ",", "$", "this",...
Compile a "where JSON length" clause. @param \Illuminate\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "where", "JSON", "length", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L608-L613
206,246
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.compileHaving
protected function compileHaving(array $having) { // If the having clause is "raw", we can just return the clause straight away // without doing any more processing on it. Otherwise, we will compile the // clause into SQL based on the components that make it up from builder. if ($hav...
php
protected function compileHaving(array $having) { // If the having clause is "raw", we can just return the clause straight away // without doing any more processing on it. Otherwise, we will compile the // clause into SQL based on the components that make it up from builder. if ($hav...
[ "protected", "function", "compileHaving", "(", "array", "$", "having", ")", "{", "// If the having clause is \"raw\", we can just return the clause straight away", "// without doing any more processing on it. Otherwise, we will compile the", "// clause into SQL based on the components that mak...
Compile a single having clause. @param array $having @return string
[ "Compile", "a", "single", "having", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L662-L674
206,247
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.compileHavingBetween
protected function compileHavingBetween($having) { $between = $having['not'] ? 'not between' : 'between'; $column = $this->wrap($having['column']); $min = $this->parameter(head($having['values'])); $max = $this->parameter(last($having['values'])); return $having['boolean'...
php
protected function compileHavingBetween($having) { $between = $having['not'] ? 'not between' : 'between'; $column = $this->wrap($having['column']); $min = $this->parameter(head($having['values'])); $max = $this->parameter(last($having['values'])); return $having['boolean'...
[ "protected", "function", "compileHavingBetween", "(", "$", "having", ")", "{", "$", "between", "=", "$", "having", "[", "'not'", "]", "?", "'not between'", ":", "'between'", ";", "$", "column", "=", "$", "this", "->", "wrap", "(", "$", "having", "[", "...
Compile a "between" having clause. @param array $having @return string
[ "Compile", "a", "between", "having", "clause", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L697-L708
206,248
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.compileOrdersToArray
protected function compileOrdersToArray(Builder $query, $orders) { return array_map(function ($order) { return $order['sql'] ?? $this->wrap($order['column']).' '.$order['direction']; }, $orders); }
php
protected function compileOrdersToArray(Builder $query, $orders) { return array_map(function ($order) { return $order['sql'] ?? $this->wrap($order['column']).' '.$order['direction']; }, $orders); }
[ "protected", "function", "compileOrdersToArray", "(", "Builder", "$", "query", ",", "$", "orders", ")", "{", "return", "array_map", "(", "function", "(", "$", "order", ")", "{", "return", "$", "order", "[", "'sql'", "]", "??", "$", "this", "->", "wrap", ...
Compile the query orders to an array. @param \Illuminate\Database\Query\Builder $query @param array $orders @return array
[ "Compile", "the", "query", "orders", "to", "an", "array", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L733-L738
206,249
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.compileUnionAggregate
protected function compileUnionAggregate(Builder $query) { $sql = $this->compileAggregate($query, $query->aggregate); $query->aggregate = null; return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table'); }
php
protected function compileUnionAggregate(Builder $query) { $sql = $this->compileAggregate($query, $query->aggregate); $query->aggregate = null; return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table'); }
[ "protected", "function", "compileUnionAggregate", "(", "Builder", "$", "query", ")", "{", "$", "sql", "=", "$", "this", "->", "compileAggregate", "(", "$", "query", ",", "$", "query", "->", "aggregate", ")", ";", "$", "query", "->", "aggregate", "=", "nu...
Compile a union aggregate query into SQL. @param \Illuminate\Database\Query\Builder $query @return string
[ "Compile", "a", "union", "aggregate", "query", "into", "SQL", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L823-L830
206,250
laravel/framework
src/Illuminate/Database/Query/Grammars/Grammar.php
Grammar.wrapJsonFieldAndPath
protected function wrapJsonFieldAndPath($column) { $parts = explode('->', $column, 2); $field = $this->wrap($parts[0]); $path = count($parts) > 1 ? ', '.$this->wrapJsonPath($parts[1], '->') : ''; return [$field, $path]; }
php
protected function wrapJsonFieldAndPath($column) { $parts = explode('->', $column, 2); $field = $this->wrap($parts[0]); $path = count($parts) > 1 ? ', '.$this->wrapJsonPath($parts[1], '->') : ''; return [$field, $path]; }
[ "protected", "function", "wrapJsonFieldAndPath", "(", "$", "column", ")", "{", "$", "parts", "=", "explode", "(", "'->'", ",", "$", "column", ",", "2", ")", ";", "$", "field", "=", "$", "this", "->", "wrap", "(", "$", "parts", "[", "0", "]", ")", ...
Split the given JSON selector into the field and the optional path and wrap them separately. @param string $column @return array
[ "Split", "the", "given", "JSON", "selector", "into", "the", "field", "and", "the", "optional", "path", "and", "wrap", "them", "separately", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Grammars/Grammar.php#L1100-L1109
206,251
laravel/framework
src/Illuminate/Console/Scheduling/Schedule.php
Schedule.serverShouldRun
public function serverShouldRun(Event $event, DateTimeInterface $time) { return $this->schedulingMutex->create($event, $time); }
php
public function serverShouldRun(Event $event, DateTimeInterface $time) { return $this->schedulingMutex->create($event, $time); }
[ "public", "function", "serverShouldRun", "(", "Event", "$", "event", ",", "DateTimeInterface", "$", "time", ")", "{", "return", "$", "this", "->", "schedulingMutex", "->", "create", "(", "$", "event", ",", "$", "time", ")", ";", "}" ]
Determine if the server is allowed to run this event. @param \Illuminate\Console\Scheduling\Event $event @param \DateTimeInterface $time @return bool
[ "Determine", "if", "the", "server", "is", "allowed", "to", "run", "this", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Schedule.php#L165-L168
206,252
laravel/framework
src/Illuminate/Console/Scheduling/Schedule.php
Schedule.useCache
public function useCache($store) { if ($this->eventMutex instanceof CacheEventMutex) { $this->eventMutex->useStore($store); } if ($this->schedulingMutex instanceof CacheSchedulingMutex) { $this->schedulingMutex->useStore($store); } return $this; ...
php
public function useCache($store) { if ($this->eventMutex instanceof CacheEventMutex) { $this->eventMutex->useStore($store); } if ($this->schedulingMutex instanceof CacheSchedulingMutex) { $this->schedulingMutex->useStore($store); } return $this; ...
[ "public", "function", "useCache", "(", "$", "store", ")", "{", "if", "(", "$", "this", "->", "eventMutex", "instanceof", "CacheEventMutex", ")", "{", "$", "this", "->", "eventMutex", "->", "useStore", "(", "$", "store", ")", ";", "}", "if", "(", "$", ...
Specify the cache store that should be used to store mutexes. @param string $store @return $this
[ "Specify", "the", "cache", "store", "that", "should", "be", "used", "to", "store", "mutexes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/Schedule.php#L197-L208
206,253
laravel/framework
src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
AuthorizesRequests.authorize
public function authorize($ability, $arguments = []) { [$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments); return app(Gate::class)->authorize($ability, $arguments); }
php
public function authorize($ability, $arguments = []) { [$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments); return app(Gate::class)->authorize($ability, $arguments); }
[ "public", "function", "authorize", "(", "$", "ability", ",", "$", "arguments", "=", "[", "]", ")", "{", "[", "$", "ability", ",", "$", "arguments", "]", "=", "$", "this", "->", "parseAbilityAndArguments", "(", "$", "ability", ",", "$", "arguments", ")"...
Authorize a given action for the current user. @param mixed $ability @param mixed|array $arguments @return \Illuminate\Auth\Access\Response @throws \Illuminate\Auth\Access\AuthorizationException
[ "Authorize", "a", "given", "action", "for", "the", "current", "user", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php#L19-L24
206,254
laravel/framework
src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
AuthorizesRequests.authorizeResource
public function authorizeResource($model, $parameter = null, array $options = [], $request = null) { $parameter = $parameter ?: Str::snake(class_basename($model)); $middleware = []; foreach ($this->resourceAbilityMap() as $method => $ability) { $modelName = in_array($method, $t...
php
public function authorizeResource($model, $parameter = null, array $options = [], $request = null) { $parameter = $parameter ?: Str::snake(class_basename($model)); $middleware = []; foreach ($this->resourceAbilityMap() as $method => $ability) { $modelName = in_array($method, $t...
[ "public", "function", "authorizeResource", "(", "$", "model", ",", "$", "parameter", "=", "null", ",", "array", "$", "options", "=", "[", "]", ",", "$", "request", "=", "null", ")", "{", "$", "parameter", "=", "$", "parameter", "?", ":", "Str", "::",...
Authorize a resource action based on the incoming request. @param string $model @param string|null $parameter @param array $options @param \Illuminate\Http\Request|null $request @return void
[ "Authorize", "a", "resource", "action", "based", "on", "the", "incoming", "request", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php#L83-L98
206,255
laravel/framework
src/Illuminate/Database/Connectors/PostgresConnector.php
PostgresConnector.addSslOptions
protected function addSslOptions($dsn, array $config) { foreach (['sslmode', 'sslcert', 'sslkey', 'sslrootcert'] as $option) { if (isset($config[$option])) { $dsn .= ";{$option}={$config[$option]}"; } } return $dsn; }
php
protected function addSslOptions($dsn, array $config) { foreach (['sslmode', 'sslcert', 'sslkey', 'sslrootcert'] as $option) { if (isset($config[$option])) { $dsn .= ";{$option}={$config[$option]}"; } } return $dsn; }
[ "protected", "function", "addSslOptions", "(", "$", "dsn", ",", "array", "$", "config", ")", "{", "foreach", "(", "[", "'sslmode'", ",", "'sslcert'", ",", "'sslkey'", ",", "'sslrootcert'", "]", "as", "$", "option", ")", "{", "if", "(", "isset", "(", "$...
Add the SSL options to the DSN. @param string $dsn @param array $config @return string
[ "Add", "the", "SSL", "options", "to", "the", "DSN", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/PostgresConnector.php#L166-L175
206,256
laravel/framework
src/Illuminate/Database/Query/Processors/SqlServerProcessor.php
SqlServerProcessor.processInsertGetIdForOdbc
protected function processInsertGetIdForOdbc(Connection $connection) { $result = $connection->selectFromWriteConnection( 'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid' ); if (! $result) { throw new Exception('Unable to retrieve lastInsertID ...
php
protected function processInsertGetIdForOdbc(Connection $connection) { $result = $connection->selectFromWriteConnection( 'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid' ); if (! $result) { throw new Exception('Unable to retrieve lastInsertID ...
[ "protected", "function", "processInsertGetIdForOdbc", "(", "Connection", "$", "connection", ")", "{", "$", "result", "=", "$", "connection", "->", "selectFromWriteConnection", "(", "'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid'", ")", ";", "if", "...
Process an "insert get ID" query for ODBC. @param \Illuminate\Database\Connection $connection @return int @throws \Exception
[ "Process", "an", "insert", "get", "ID", "query", "for", "ODBC", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php#L43-L56
206,257
laravel/framework
src/Illuminate/Console/Scheduling/ScheduleRunCommand.php
ScheduleRunCommand.runSingleServerEvent
protected function runSingleServerEvent($event) { if ($this->schedule->serverShouldRun($event, $this->startedAt)) { $this->runEvent($event); } else { $this->line('<info>Skipping command (has already run on another server):</info> '.$event->getSummaryForDisplay()); } ...
php
protected function runSingleServerEvent($event) { if ($this->schedule->serverShouldRun($event, $this->startedAt)) { $this->runEvent($event); } else { $this->line('<info>Skipping command (has already run on another server):</info> '.$event->getSummaryForDisplay()); } ...
[ "protected", "function", "runSingleServerEvent", "(", "$", "event", ")", "{", "if", "(", "$", "this", "->", "schedule", "->", "serverShouldRun", "(", "$", "event", ",", "$", "this", "->", "startedAt", ")", ")", "{", "$", "this", "->", "runEvent", "(", ...
Run the given single server event. @param \Illuminate\Console\Scheduling\Event $event @return void
[ "Run", "the", "given", "single", "server", "event", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php#L92-L99
206,258
laravel/framework
src/Illuminate/Routing/RouteCollection.php
RouteCollection.addLookups
protected function addLookups($route) { // If the route has a name, we will add it to the name look-up table so that we // will quickly be able to find any route associate with a name and not have // to iterate through every route every time we need to perform a look-up. if ($name = ...
php
protected function addLookups($route) { // If the route has a name, we will add it to the name look-up table so that we // will quickly be able to find any route associate with a name and not have // to iterate through every route every time we need to perform a look-up. if ($name = ...
[ "protected", "function", "addLookups", "(", "$", "route", ")", "{", "// If the route has a name, we will add it to the name look-up table so that we", "// will quickly be able to find any route associate with a name and not have", "// to iterate through every route every time we need to perform ...
Add the route to any look-up tables if necessary. @param \Illuminate\Routing\Route $route @return void
[ "Add", "the", "route", "to", "any", "look", "-", "up", "tables", "if", "necessary", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteCollection.php#L82-L99
206,259
laravel/framework
src/Illuminate/Routing/RouteCollection.php
RouteCollection.refreshNameLookups
public function refreshNameLookups() { $this->nameList = []; foreach ($this->allRoutes as $route) { if ($route->getName()) { $this->nameList[$route->getName()] = $route; } } }
php
public function refreshNameLookups() { $this->nameList = []; foreach ($this->allRoutes as $route) { if ($route->getName()) { $this->nameList[$route->getName()] = $route; } } }
[ "public", "function", "refreshNameLookups", "(", ")", "{", "$", "this", "->", "nameList", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "allRoutes", "as", "$", "route", ")", "{", "if", "(", "$", "route", "->", "getName", "(", ")", ")", "{"...
Refresh the name look-up table. This is done in case any names are fluently defined or if routes are overwritten. @return void
[ "Refresh", "the", "name", "look", "-", "up", "table", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteCollection.php#L120-L129
206,260
laravel/framework
src/Illuminate/Routing/RouteCollection.php
RouteCollection.refreshActionLookups
public function refreshActionLookups() { $this->actionList = []; foreach ($this->allRoutes as $route) { if (isset($route->getAction()['controller'])) { $this->addToActionList($route->getAction(), $route); } } }
php
public function refreshActionLookups() { $this->actionList = []; foreach ($this->allRoutes as $route) { if (isset($route->getAction()['controller'])) { $this->addToActionList($route->getAction(), $route); } } }
[ "public", "function", "refreshActionLookups", "(", ")", "{", "$", "this", "->", "actionList", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "allRoutes", "as", "$", "route", ")", "{", "if", "(", "isset", "(", "$", "route", "->", "getAction", ...
Refresh the action look-up table. This is done in case any actions are overwritten with new controllers. @return void
[ "Refresh", "the", "action", "look", "-", "up", "table", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteCollection.php#L138-L147
206,261
laravel/framework
src/Illuminate/Routing/RouteCollection.php
RouteCollection.get
public function get($method = null) { return is_null($method) ? $this->getRoutes() : Arr::get($this->routes, $method, []); }
php
public function get($method = null) { return is_null($method) ? $this->getRoutes() : Arr::get($this->routes, $method, []); }
[ "public", "function", "get", "(", "$", "method", "=", "null", ")", "{", "return", "is_null", "(", "$", "method", ")", "?", "$", "this", "->", "getRoutes", "(", ")", ":", "Arr", "::", "get", "(", "$", "this", "->", "routes", ",", "$", "method", ",...
Get routes from the collection by method. @param string|null $method @return array
[ "Get", "routes", "from", "the", "collection", "by", "method", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteCollection.php#L272-L275
206,262
laravel/framework
src/Illuminate/Routing/Route.php
Route.bind
public function bind(Request $request) { $this->compileRoute(); $this->parameters = (new RouteParameterBinder($this)) ->parameters($request); $this->originalParameters = $this->parameters; return $this; }
php
public function bind(Request $request) { $this->compileRoute(); $this->parameters = (new RouteParameterBinder($this)) ->parameters($request); $this->originalParameters = $this->parameters; return $this; }
[ "public", "function", "bind", "(", "Request", "$", "request", ")", "{", "$", "this", "->", "compileRoute", "(", ")", ";", "$", "this", "->", "parameters", "=", "(", "new", "RouteParameterBinder", "(", "$", "this", ")", ")", "->", "parameters", "(", "$"...
Bind the route to a given request for execution. @param \Illuminate\Http\Request $request @return $this
[ "Bind", "the", "route", "to", "a", "given", "request", "for", "execution", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L303-L313
206,263
laravel/framework
src/Illuminate/Routing/Route.php
Route.where
public function where($name, $expression = null) { foreach ($this->parseWhere($name, $expression) as $name => $expression) { $this->wheres[$name] = $expression; } return $this; }
php
public function where($name, $expression = null) { foreach ($this->parseWhere($name, $expression) as $name => $expression) { $this->wheres[$name] = $expression; } return $this; }
[ "public", "function", "where", "(", "$", "name", ",", "$", "expression", "=", "null", ")", "{", "foreach", "(", "$", "this", "->", "parseWhere", "(", "$", "name", ",", "$", "expression", ")", "as", "$", "name", "=>", "$", "expression", ")", "{", "$...
Set a regular expression requirement on the route. @param array|string $name @param string $expression @return $this
[ "Set", "a", "regular", "expression", "requirement", "on", "the", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L495-L502
206,264
laravel/framework
src/Illuminate/Routing/Route.php
Route.whereArray
protected function whereArray(array $wheres) { foreach ($wheres as $name => $expression) { $this->where($name, $expression); } return $this; }
php
protected function whereArray(array $wheres) { foreach ($wheres as $name => $expression) { $this->where($name, $expression); } return $this; }
[ "protected", "function", "whereArray", "(", "array", "$", "wheres", ")", "{", "foreach", "(", "$", "wheres", "as", "$", "name", "=>", "$", "expression", ")", "{", "$", "this", "->", "where", "(", "$", "name", ",", "$", "expression", ")", ";", "}", ...
Set a list of regular expression requirements on the route. @param array $wheres @return $this
[ "Set", "a", "list", "of", "regular", "expression", "requirements", "on", "the", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L522-L529
206,265
laravel/framework
src/Illuminate/Routing/Route.php
Route.domain
public function domain($domain = null) { if (is_null($domain)) { return $this->getDomain(); } $this->action['domain'] = $domain; return $this; }
php
public function domain($domain = null) { if (is_null($domain)) { return $this->getDomain(); } $this->action['domain'] = $domain; return $this; }
[ "public", "function", "domain", "(", "$", "domain", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "domain", ")", ")", "{", "return", "$", "this", "->", "getDomain", "(", ")", ";", "}", "$", "this", "->", "action", "[", "'domain'", "]", "...
Get or set the domain for the route. @param string|null $domain @return $this|string|null
[ "Get", "or", "set", "the", "domain", "for", "the", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L589-L598
206,266
laravel/framework
src/Illuminate/Routing/Route.php
Route.named
public function named(...$patterns) { if (is_null($routeName = $this->getName())) { return false; } foreach ($patterns as $pattern) { if (Str::is($pattern, $routeName)) { return true; } } return false; }
php
public function named(...$patterns) { if (is_null($routeName = $this->getName())) { return false; } foreach ($patterns as $pattern) { if (Str::is($pattern, $routeName)) { return true; } } return false; }
[ "public", "function", "named", "(", "...", "$", "patterns", ")", "{", "if", "(", "is_null", "(", "$", "routeName", "=", "$", "this", "->", "getName", "(", ")", ")", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "patterns", "as", "$", ...
Determine whether the route's name matches the given patterns. @param mixed ...$patterns @return bool
[ "Determine", "whether", "the", "route", "s", "name", "matches", "the", "given", "patterns", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L688-L701
206,267
laravel/framework
src/Illuminate/Routing/Route.php
Route.uses
public function uses($action) { $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action; return $this->setAction(array_merge($this->action, $this->parseAction([ 'uses' => $action, 'controller' => $action, ]))); }
php
public function uses($action) { $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action; return $this->setAction(array_merge($this->action, $this->parseAction([ 'uses' => $action, 'controller' => $action, ]))); }
[ "public", "function", "uses", "(", "$", "action", ")", "{", "$", "action", "=", "is_string", "(", "$", "action", ")", "?", "$", "this", "->", "addGroupNamespaceToStringUses", "(", "$", "action", ")", ":", "$", "action", ";", "return", "$", "this", "->"...
Set the handler for the route. @param \Closure|string $action @return $this
[ "Set", "the", "handler", "for", "the", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L709-L717
206,268
laravel/framework
src/Illuminate/Routing/Route.php
Route.addGroupNamespaceToStringUses
protected function addGroupNamespaceToStringUses($action) { $groupStack = last($this->router->getGroupStack()); if (isset($groupStack['namespace']) && strpos($action, '\\') !== 0) { return $groupStack['namespace'].'\\'.$action; } return $action; }
php
protected function addGroupNamespaceToStringUses($action) { $groupStack = last($this->router->getGroupStack()); if (isset($groupStack['namespace']) && strpos($action, '\\') !== 0) { return $groupStack['namespace'].'\\'.$action; } return $action; }
[ "protected", "function", "addGroupNamespaceToStringUses", "(", "$", "action", ")", "{", "$", "groupStack", "=", "last", "(", "$", "this", "->", "router", "->", "getGroupStack", "(", ")", ")", ";", "if", "(", "isset", "(", "$", "groupStack", "[", "'namespac...
Parse a string based action for the "uses" fluent method. @param string $action @return string
[ "Parse", "a", "string", "based", "action", "for", "the", "uses", "fluent", "method", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L725-L734
206,269
laravel/framework
src/Illuminate/Routing/Route.php
Route.gatherMiddleware
public function gatherMiddleware() { if (! is_null($this->computedMiddleware)) { return $this->computedMiddleware; } $this->computedMiddleware = []; return $this->computedMiddleware = array_unique(array_merge( $this->middleware(), $this->controllerMiddleware...
php
public function gatherMiddleware() { if (! is_null($this->computedMiddleware)) { return $this->computedMiddleware; } $this->computedMiddleware = []; return $this->computedMiddleware = array_unique(array_merge( $this->middleware(), $this->controllerMiddleware...
[ "public", "function", "gatherMiddleware", "(", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "computedMiddleware", ")", ")", "{", "return", "$", "this", "->", "computedMiddleware", ";", "}", "$", "this", "->", "computedMiddleware", "=", "[",...
Get all middleware, including the ones from the controller. @return array
[ "Get", "all", "middleware", "including", "the", "ones", "from", "the", "controller", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L785-L796
206,270
laravel/framework
src/Illuminate/Routing/Route.php
Route.controllerMiddleware
public function controllerMiddleware() { if (! $this->isControllerAction()) { return []; } return $this->controllerDispatcher()->getMiddleware( $this->getController(), $this->getControllerMethod() ); }
php
public function controllerMiddleware() { if (! $this->isControllerAction()) { return []; } return $this->controllerDispatcher()->getMiddleware( $this->getController(), $this->getControllerMethod() ); }
[ "public", "function", "controllerMiddleware", "(", ")", "{", "if", "(", "!", "$", "this", "->", "isControllerAction", "(", ")", ")", "{", "return", "[", "]", ";", "}", "return", "$", "this", "->", "controllerDispatcher", "(", ")", "->", "getMiddleware", ...
Get the middleware for the route's controller. @return array
[ "Get", "the", "middleware", "for", "the", "route", "s", "controller", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L826-L835
206,271
laravel/framework
src/Illuminate/Routing/Route.php
Route.controllerDispatcher
public function controllerDispatcher() { if ($this->container->bound(ControllerDispatcherContract::class)) { return $this->container->make(ControllerDispatcherContract::class); } return new ControllerDispatcher($this->container); }
php
public function controllerDispatcher() { if ($this->container->bound(ControllerDispatcherContract::class)) { return $this->container->make(ControllerDispatcherContract::class); } return new ControllerDispatcher($this->container); }
[ "public", "function", "controllerDispatcher", "(", ")", "{", "if", "(", "$", "this", "->", "container", "->", "bound", "(", "ControllerDispatcherContract", "::", "class", ")", ")", "{", "return", "$", "this", "->", "container", "->", "make", "(", "Controller...
Get the dispatcher for the route's controller. @return \Illuminate\Routing\Contracts\ControllerDispatcher
[ "Get", "the", "dispatcher", "for", "the", "route", "s", "controller", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Route.php#L842-L849
206,272
laravel/framework
src/Illuminate/View/Concerns/ManagesLayouts.php
ManagesLayouts.parentPlaceholder
public static function parentPlaceholder($section = '') { if (! isset(static::$parentPlaceholder[$section])) { static::$parentPlaceholder[$section] = '##parent-placeholder-'.sha1($section).'##'; } return static::$parentPlaceholder[$section]; }
php
public static function parentPlaceholder($section = '') { if (! isset(static::$parentPlaceholder[$section])) { static::$parentPlaceholder[$section] = '##parent-placeholder-'.sha1($section).'##'; } return static::$parentPlaceholder[$section]; }
[ "public", "static", "function", "parentPlaceholder", "(", "$", "section", "=", "''", ")", "{", "if", "(", "!", "isset", "(", "static", "::", "$", "parentPlaceholder", "[", "$", "section", "]", ")", ")", "{", "static", "::", "$", "parentPlaceholder", "[",...
Get the parent placeholder for the current request. @param string $section @return string
[ "Get", "the", "parent", "placeholder", "for", "the", "current", "request", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesLayouts.php#L168-L175
206,273
laravel/framework
src/Illuminate/Foundation/Console/VendorPublishCommand.php
VendorPublishCommand.promptForProviderOrTag
protected function promptForProviderOrTag() { $choice = $this->choice( "Which provider or tag's files would you like to publish?", $choices = $this->publishableChoices() ); if ($choice == $choices[0] || is_null($choice)) { return; } $this...
php
protected function promptForProviderOrTag() { $choice = $this->choice( "Which provider or tag's files would you like to publish?", $choices = $this->publishableChoices() ); if ($choice == $choices[0] || is_null($choice)) { return; } $this...
[ "protected", "function", "promptForProviderOrTag", "(", ")", "{", "$", "choice", "=", "$", "this", "->", "choice", "(", "\"Which provider or tag's files would you like to publish?\"", ",", "$", "choices", "=", "$", "this", "->", "publishableChoices", "(", ")", ")", ...
Prompt for which provider or tag to publish. @return void
[ "Prompt", "for", "which", "provider", "or", "tag", "to", "publish", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L107-L119
206,274
laravel/framework
src/Illuminate/Foundation/Console/VendorPublishCommand.php
VendorPublishCommand.publishableChoices
protected function publishableChoices() { return array_merge( ['<comment>Publish files from all providers and tags listed below</comment>'], preg_filter('/^/', '<comment>Provider: </comment>', Arr::sort(ServiceProvider::publishableProviders())), preg_filter('/^/', '<comme...
php
protected function publishableChoices() { return array_merge( ['<comment>Publish files from all providers and tags listed below</comment>'], preg_filter('/^/', '<comment>Provider: </comment>', Arr::sort(ServiceProvider::publishableProviders())), preg_filter('/^/', '<comme...
[ "protected", "function", "publishableChoices", "(", ")", "{", "return", "array_merge", "(", "[", "'<comment>Publish files from all providers and tags listed below</comment>'", "]", ",", "preg_filter", "(", "'/^/'", ",", "'<comment>Provider: </comment>'", ",", "Arr", "::", "...
The choices available via the prompt. @return array
[ "The", "choices", "available", "via", "the", "prompt", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L126-L133
206,275
laravel/framework
src/Illuminate/Foundation/Console/VendorPublishCommand.php
VendorPublishCommand.publishTag
protected function publishTag($tag) { foreach ($this->pathsToPublish($tag) as $from => $to) { $this->publishItem($from, $to); } }
php
protected function publishTag($tag) { foreach ($this->pathsToPublish($tag) as $from => $to) { $this->publishItem($from, $to); } }
[ "protected", "function", "publishTag", "(", "$", "tag", ")", "{", "foreach", "(", "$", "this", "->", "pathsToPublish", "(", "$", "tag", ")", "as", "$", "from", "=>", "$", "to", ")", "{", "$", "this", "->", "publishItem", "(", "$", "from", ",", "$",...
Publishes the assets for a tag. @param string $tag @return mixed
[ "Publishes", "the", "assets", "for", "a", "tag", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L158-L163
206,276
laravel/framework
src/Illuminate/Foundation/Console/VendorPublishCommand.php
VendorPublishCommand.publishItem
protected function publishItem($from, $to) { if ($this->files->isFile($from)) { return $this->publishFile($from, $to); } elseif ($this->files->isDirectory($from)) { return $this->publishDirectory($from, $to); } $this->error("Can't locate path: <{$from}>"); ...
php
protected function publishItem($from, $to) { if ($this->files->isFile($from)) { return $this->publishFile($from, $to); } elseif ($this->files->isDirectory($from)) { return $this->publishDirectory($from, $to); } $this->error("Can't locate path: <{$from}>"); ...
[ "protected", "function", "publishItem", "(", "$", "from", ",", "$", "to", ")", "{", "if", "(", "$", "this", "->", "files", "->", "isFile", "(", "$", "from", ")", ")", "{", "return", "$", "this", "->", "publishFile", "(", "$", "from", ",", "$", "t...
Publish the given item from and to the given location. @param string $from @param string $to @return void
[ "Publish", "the", "given", "item", "from", "and", "to", "the", "given", "location", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L185-L194
206,277
laravel/framework
src/Illuminate/Foundation/Console/VendorPublishCommand.php
VendorPublishCommand.moveManagedFiles
protected function moveManagedFiles($manager) { foreach ($manager->listContents('from://', true) as $file) { if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) { $manager->put('to://'.$file['path'], $manager->read('from://'.$file['...
php
protected function moveManagedFiles($manager) { foreach ($manager->listContents('from://', true) as $file) { if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) { $manager->put('to://'.$file['path'], $manager->read('from://'.$file['...
[ "protected", "function", "moveManagedFiles", "(", "$", "manager", ")", "{", "foreach", "(", "$", "manager", "->", "listContents", "(", "'from://'", ",", "true", ")", "as", "$", "file", ")", "{", "if", "(", "$", "file", "[", "'type'", "]", "===", "'file...
Move all the files in the given MountManager. @param \League\Flysystem\MountManager $manager @return void
[ "Move", "all", "the", "files", "in", "the", "given", "MountManager", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L237-L244
206,278
laravel/framework
src/Illuminate/Queue/CallQueuedHandler.php
CallQueuedHandler.resolveHandler
protected function resolveHandler($job, $command) { $handler = $this->dispatcher->getCommandHandler($command) ?: null; if ($handler) { $this->setJobInstanceIfNecessary($job, $handler); } return $handler; }
php
protected function resolveHandler($job, $command) { $handler = $this->dispatcher->getCommandHandler($command) ?: null; if ($handler) { $this->setJobInstanceIfNecessary($job, $handler); } return $handler; }
[ "protected", "function", "resolveHandler", "(", "$", "job", ",", "$", "command", ")", "{", "$", "handler", "=", "$", "this", "->", "dispatcher", "->", "getCommandHandler", "(", "$", "command", ")", "?", ":", "null", ";", "if", "(", "$", "handler", ")",...
Resolve the handler for the given command. @param \Illuminate\Contracts\Queue\Job $job @param mixed $command @return mixed
[ "Resolve", "the", "handler", "for", "the", "given", "command", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/CallQueuedHandler.php#L68-L77
206,279
laravel/framework
src/Illuminate/Queue/SyncQueue.php
SyncQueue.resolveJob
protected function resolveJob($payload, $queue) { return new SyncJob($this->container, $payload, $this->connectionName, $queue); }
php
protected function resolveJob($payload, $queue) { return new SyncJob($this->container, $payload, $this->connectionName, $queue); }
[ "protected", "function", "resolveJob", "(", "$", "payload", ",", "$", "queue", ")", "{", "return", "new", "SyncJob", "(", "$", "this", "->", "container", ",", "$", "payload", ",", "$", "this", "->", "connectionName", ",", "$", "queue", ")", ";", "}" ]
Resolve a Sync job instance. @param string $payload @param string $queue @return \Illuminate\Queue\Jobs\SyncJob
[ "Resolve", "a", "Sync", "job", "instance", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SyncQueue.php#L61-L64
206,280
laravel/framework
src/Illuminate/Auth/Middleware/Authorize.php
Authorize.getGateArguments
protected function getGateArguments($request, $models) { if (is_null($models)) { return []; } return collect($models)->map(function ($model) use ($request) { return $model instanceof Model ? $model : $this->getModel($request, $model); })->all(); }
php
protected function getGateArguments($request, $models) { if (is_null($models)) { return []; } return collect($models)->map(function ($model) use ($request) { return $model instanceof Model ? $model : $this->getModel($request, $model); })->all(); }
[ "protected", "function", "getGateArguments", "(", "$", "request", ",", "$", "models", ")", "{", "if", "(", "is_null", "(", "$", "models", ")", ")", "{", "return", "[", "]", ";", "}", "return", "collect", "(", "$", "models", ")", "->", "map", "(", "...
Get the arguments parameter for the gate. @param \Illuminate\Http\Request $request @param array|null $models @return array|string|\Illuminate\Database\Eloquent\Model
[ "Get", "the", "arguments", "parameter", "for", "the", "gate", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Middleware/Authorize.php#L55-L64
206,281
laravel/framework
src/Illuminate/Auth/Middleware/Authorize.php
Authorize.getModel
protected function getModel($request, $model) { if ($this->isClassName($model)) { return trim($model); } else { return $request->route($model, null) ?: ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null); } }
php
protected function getModel($request, $model) { if ($this->isClassName($model)) { return trim($model); } else { return $request->route($model, null) ?: ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null); } }
[ "protected", "function", "getModel", "(", "$", "request", ",", "$", "model", ")", "{", "if", "(", "$", "this", "->", "isClassName", "(", "$", "model", ")", ")", "{", "return", "trim", "(", "$", "model", ")", ";", "}", "else", "{", "return", "$", ...
Get the model to authorize. @param \Illuminate\Http\Request $request @param string $model @return \Illuminate\Database\Eloquent\Model|string
[ "Get", "the", "model", "to", "authorize", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Auth/Middleware/Authorize.php#L73-L81
206,282
laravel/framework
src/Illuminate/View/Concerns/ManagesStacks.php
ManagesStacks.startPush
public function startPush($section, $content = '') { if ($content === '') { if (ob_start()) { $this->pushStack[] = $section; } } else { $this->extendPush($section, $content); } }
php
public function startPush($section, $content = '') { if ($content === '') { if (ob_start()) { $this->pushStack[] = $section; } } else { $this->extendPush($section, $content); } }
[ "public", "function", "startPush", "(", "$", "section", ",", "$", "content", "=", "''", ")", "{", "if", "(", "$", "content", "===", "''", ")", "{", "if", "(", "ob_start", "(", ")", ")", "{", "$", "this", "->", "pushStack", "[", "]", "=", "$", "...
Start injecting content into a push section. @param string $section @param string $content @return void
[ "Start", "injecting", "content", "into", "a", "push", "section", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesStacks.php#L37-L46
206,283
laravel/framework
src/Illuminate/View/Concerns/ManagesStacks.php
ManagesStacks.extendPush
protected function extendPush($section, $content) { if (! isset($this->pushes[$section])) { $this->pushes[$section] = []; } if (! isset($this->pushes[$section][$this->renderCount])) { $this->pushes[$section][$this->renderCount] = $content; } else { ...
php
protected function extendPush($section, $content) { if (! isset($this->pushes[$section])) { $this->pushes[$section] = []; } if (! isset($this->pushes[$section][$this->renderCount])) { $this->pushes[$section][$this->renderCount] = $content; } else { ...
[ "protected", "function", "extendPush", "(", "$", "section", ",", "$", "content", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "pushes", "[", "$", "section", "]", ")", ")", "{", "$", "this", "->", "pushes", "[", "$", "section", "]", ...
Append content to a given push section. @param string $section @param string $content @return void
[ "Append", "content", "to", "a", "given", "push", "section", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesStacks.php#L73-L84
206,284
laravel/framework
src/Illuminate/View/Concerns/ManagesStacks.php
ManagesStacks.startPrepend
public function startPrepend($section, $content = '') { if ($content === '') { if (ob_start()) { $this->pushStack[] = $section; } } else { $this->extendPrepend($section, $content); } }
php
public function startPrepend($section, $content = '') { if ($content === '') { if (ob_start()) { $this->pushStack[] = $section; } } else { $this->extendPrepend($section, $content); } }
[ "public", "function", "startPrepend", "(", "$", "section", ",", "$", "content", "=", "''", ")", "{", "if", "(", "$", "content", "===", "''", ")", "{", "if", "(", "ob_start", "(", ")", ")", "{", "$", "this", "->", "pushStack", "[", "]", "=", "$", ...
Start prepending content into a push section. @param string $section @param string $content @return void
[ "Start", "prepending", "content", "into", "a", "push", "section", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesStacks.php#L93-L102
206,285
laravel/framework
src/Illuminate/View/Concerns/ManagesStacks.php
ManagesStacks.stopPrepend
public function stopPrepend() { if (empty($this->pushStack)) { throw new InvalidArgumentException('Cannot end a prepend operation without first starting one.'); } return tap(array_pop($this->pushStack), function ($last) { $this->extendPrepend($last, ob_get_clean()); ...
php
public function stopPrepend() { if (empty($this->pushStack)) { throw new InvalidArgumentException('Cannot end a prepend operation without first starting one.'); } return tap(array_pop($this->pushStack), function ($last) { $this->extendPrepend($last, ob_get_clean()); ...
[ "public", "function", "stopPrepend", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "pushStack", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Cannot end a prepend operation without first starting one.'", ")", ";", "}", "return", "t...
Stop prepending content into a push section. @return string @throws \InvalidArgumentException
[ "Stop", "prepending", "content", "into", "a", "push", "section", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesStacks.php#L111-L120
206,286
laravel/framework
src/Illuminate/View/Concerns/ManagesStacks.php
ManagesStacks.extendPrepend
protected function extendPrepend($section, $content) { if (! isset($this->prepends[$section])) { $this->prepends[$section] = []; } if (! isset($this->prepends[$section][$this->renderCount])) { $this->prepends[$section][$this->renderCount] = $content; } else {...
php
protected function extendPrepend($section, $content) { if (! isset($this->prepends[$section])) { $this->prepends[$section] = []; } if (! isset($this->prepends[$section][$this->renderCount])) { $this->prepends[$section][$this->renderCount] = $content; } else {...
[ "protected", "function", "extendPrepend", "(", "$", "section", ",", "$", "content", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "prepends", "[", "$", "section", "]", ")", ")", "{", "$", "this", "->", "prepends", "[", "$", "section", ...
Prepend content to a given stack. @param string $section @param string $content @return void
[ "Prepend", "content", "to", "a", "given", "stack", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Concerns/ManagesStacks.php#L129-L140
206,287
laravel/framework
src/Illuminate/Routing/PendingResourceRegistration.php
PendingResourceRegistration.register
public function register() { $this->registered = true; return $this->registrar->register( $this->name, $this->controller, $this->options ); }
php
public function register() { $this->registered = true; return $this->registrar->register( $this->name, $this->controller, $this->options ); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "registered", "=", "true", ";", "return", "$", "this", "->", "registrar", "->", "register", "(", "$", "this", "->", "name", ",", "$", "this", "->", "controller", ",", "$", "this", "-...
Register the resource route. @return \Illuminate\Routing\RouteCollection
[ "Register", "the", "resource", "route", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/PendingResourceRegistration.php#L161-L168
206,288
laravel/framework
src/Illuminate/Container/BoundMethod.php
BoundMethod.callBoundMethod
protected static function callBoundMethod($container, $callback, $default) { if (! is_array($callback)) { return $default instanceof Closure ? $default() : $default; } // Here we need to turn the array callable into a Class@method string we can use to // examine the cont...
php
protected static function callBoundMethod($container, $callback, $default) { if (! is_array($callback)) { return $default instanceof Closure ? $default() : $default; } // Here we need to turn the array callable into a Class@method string we can use to // examine the cont...
[ "protected", "static", "function", "callBoundMethod", "(", "$", "container", ",", "$", "callback", ",", "$", "default", ")", "{", "if", "(", "!", "is_array", "(", "$", "callback", ")", ")", "{", "return", "$", "default", "instanceof", "Closure", "?", "$"...
Call a method that has been bound to the container. @param \Illuminate\Container\Container $container @param callable $callback @param mixed $default @return mixed
[ "Call", "a", "method", "that", "has", "been", "bound", "to", "the", "container", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/BoundMethod.php#L75-L91
206,289
laravel/framework
src/Illuminate/Container/BoundMethod.php
BoundMethod.addDependencyForCallParameter
protected static function addDependencyForCallParameter($container, $parameter, array &$parameters, &$dependencies) { if (array_key_exists($parameter->name, $parameters)) { $dependencies[] = $parameters[$parameter->name]; u...
php
protected static function addDependencyForCallParameter($container, $parameter, array &$parameters, &$dependencies) { if (array_key_exists($parameter->name, $parameters)) { $dependencies[] = $parameters[$parameter->name]; u...
[ "protected", "static", "function", "addDependencyForCallParameter", "(", "$", "container", ",", "$", "parameter", ",", "array", "&", "$", "parameters", ",", "&", "$", "dependencies", ")", "{", "if", "(", "array_key_exists", "(", "$", "parameter", "->", "name",...
Get the dependency for the given call parameter. @param \Illuminate\Container\Container $container @param \ReflectionParameter $parameter @param array $parameters @param array $dependencies @return void
[ "Get", "the", "dependency", "for", "the", "given", "call", "parameter", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Container/BoundMethod.php#L155-L171
206,290
laravel/framework
src/Illuminate/Routing/RouteRegistrar.php
RouteRegistrar.attribute
public function attribute($key, $value) { if (! in_array($key, $this->allowedAttributes)) { throw new InvalidArgumentException("Attribute [{$key}] does not exist."); } $this->attributes[Arr::get($this->aliases, $key, $key)] = $value; return $this; }
php
public function attribute($key, $value) { if (! in_array($key, $this->allowedAttributes)) { throw new InvalidArgumentException("Attribute [{$key}] does not exist."); } $this->attributes[Arr::get($this->aliases, $key, $key)] = $value; return $this; }
[ "public", "function", "attribute", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "!", "in_array", "(", "$", "key", ",", "$", "this", "->", "allowedAttributes", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"Attribute [{$key}]...
Set the value for a given attribute. @param string $key @param mixed $value @return $this @throws \InvalidArgumentException
[ "Set", "the", "value", "for", "a", "given", "attribute", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteRegistrar.php#L89-L98
206,291
laravel/framework
src/Illuminate/Routing/RouteRegistrar.php
RouteRegistrar.registerRoute
protected function registerRoute($method, $uri, $action = null) { if (! is_array($action)) { $action = array_merge($this->attributes, $action ? ['uses' => $action] : []); } return $this->router->{$method}($uri, $this->compileAction($action)); }
php
protected function registerRoute($method, $uri, $action = null) { if (! is_array($action)) { $action = array_merge($this->attributes, $action ? ['uses' => $action] : []); } return $this->router->{$method}($uri, $this->compileAction($action)); }
[ "protected", "function", "registerRoute", "(", "$", "method", ",", "$", "uri", ",", "$", "action", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "action", ")", ")", "{", "$", "action", "=", "array_merge", "(", "$", "this", "->", "att...
Register a new route with the router. @param string $method @param string $uri @param \Closure|array|string|null $action @return \Illuminate\Routing\Route
[ "Register", "a", "new", "route", "with", "the", "router", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteRegistrar.php#L145-L152
206,292
laravel/framework
src/Illuminate/Routing/RouteRegistrar.php
RouteRegistrar.compileAction
protected function compileAction($action) { if (is_null($action)) { return $this->attributes; } if (is_string($action) || $action instanceof Closure) { $action = ['uses' => $action]; } return array_merge($this->attributes, $action); }
php
protected function compileAction($action) { if (is_null($action)) { return $this->attributes; } if (is_string($action) || $action instanceof Closure) { $action = ['uses' => $action]; } return array_merge($this->attributes, $action); }
[ "protected", "function", "compileAction", "(", "$", "action", ")", "{", "if", "(", "is_null", "(", "$", "action", ")", ")", "{", "return", "$", "this", "->", "attributes", ";", "}", "if", "(", "is_string", "(", "$", "action", ")", "||", "$", "action"...
Compile the action into an array including the attributes. @param \Closure|array|string|null $action @return array
[ "Compile", "the", "action", "into", "an", "array", "including", "the", "attributes", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/RouteRegistrar.php#L160-L171
206,293
laravel/framework
src/Illuminate/Foundation/Console/ViewCacheCommand.php
ViewCacheCommand.compileViews
protected function compileViews(Collection $views) { $compiler = $this->laravel['view']->getEngineResolver()->resolve('blade')->getCompiler(); $views->map(function (SplFileInfo $file) use ($compiler) { $compiler->compile($file->getRealPath()); }); }
php
protected function compileViews(Collection $views) { $compiler = $this->laravel['view']->getEngineResolver()->resolve('blade')->getCompiler(); $views->map(function (SplFileInfo $file) use ($compiler) { $compiler->compile($file->getRealPath()); }); }
[ "protected", "function", "compileViews", "(", "Collection", "$", "views", ")", "{", "$", "compiler", "=", "$", "this", "->", "laravel", "[", "'view'", "]", "->", "getEngineResolver", "(", ")", "->", "resolve", "(", "'blade'", ")", "->", "getCompiler", "(",...
Compile the given view files. @param \Illuminate\Support\Collection $views @return void
[ "Compile", "the", "given", "view", "files", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ViewCacheCommand.php#L48-L55
206,294
laravel/framework
src/Illuminate/Foundation/Console/ViewCacheCommand.php
ViewCacheCommand.bladeFilesIn
protected function bladeFilesIn(array $paths) { return collect( Finder::create() ->in($paths) ->exclude('vendor') ->name('*.blade.php') ->files() ); }
php
protected function bladeFilesIn(array $paths) { return collect( Finder::create() ->in($paths) ->exclude('vendor') ->name('*.blade.php') ->files() ); }
[ "protected", "function", "bladeFilesIn", "(", "array", "$", "paths", ")", "{", "return", "collect", "(", "Finder", "::", "create", "(", ")", "->", "in", "(", "$", "paths", ")", "->", "exclude", "(", "'vendor'", ")", "->", "name", "(", "'*.blade.php'", ...
Get the Blade files in the given path. @param array $paths @return \Illuminate\Support\Collection
[ "Get", "the", "Blade", "files", "in", "the", "given", "path", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ViewCacheCommand.php#L63-L72
206,295
laravel/framework
src/Illuminate/Foundation/Console/ViewCacheCommand.php
ViewCacheCommand.paths
protected function paths() { $finder = $this->laravel['view']->getFinder(); return collect($finder->getPaths())->merge( collect($finder->getHints())->flatten() ); }
php
protected function paths() { $finder = $this->laravel['view']->getFinder(); return collect($finder->getPaths())->merge( collect($finder->getHints())->flatten() ); }
[ "protected", "function", "paths", "(", ")", "{", "$", "finder", "=", "$", "this", "->", "laravel", "[", "'view'", "]", "->", "getFinder", "(", ")", ";", "return", "collect", "(", "$", "finder", "->", "getPaths", "(", ")", ")", "->", "merge", "(", "...
Get all of the possible view paths. @return \Illuminate\Support\Collection
[ "Get", "all", "of", "the", "possible", "view", "paths", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Foundation/Console/ViewCacheCommand.php#L79-L86
206,296
laravel/framework
src/Illuminate/Routing/Middleware/ThrottleRequests.php
ThrottleRequests.resolveMaxAttempts
protected function resolveMaxAttempts($request, $maxAttempts) { if (Str::contains($maxAttempts, '|')) { $maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0]; } if (! is_numeric($maxAttempts) && $request->user()) { $maxAttempts = $request->user()->{$...
php
protected function resolveMaxAttempts($request, $maxAttempts) { if (Str::contains($maxAttempts, '|')) { $maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0]; } if (! is_numeric($maxAttempts) && $request->user()) { $maxAttempts = $request->user()->{$...
[ "protected", "function", "resolveMaxAttempts", "(", "$", "request", ",", "$", "maxAttempts", ")", "{", "if", "(", "Str", "::", "contains", "(", "$", "maxAttempts", ",", "'|'", ")", ")", "{", "$", "maxAttempts", "=", "explode", "(", "'|'", ",", "$", "ma...
Resolve the number of attempts if the user is authenticated or not. @param \Illuminate\Http\Request $request @param int|string $maxAttempts @return int
[ "Resolve", "the", "number", "of", "attempts", "if", "the", "user", "is", "authenticated", "or", "not", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L73-L84
206,297
laravel/framework
src/Illuminate/Routing/Middleware/ThrottleRequests.php
ThrottleRequests.buildException
protected function buildException($key, $maxAttempts) { $retryAfter = $this->getTimeUntilNextRetry($key); $headers = $this->getHeaders( $maxAttempts, $this->calculateRemainingAttempts($key, $maxAttempts, $retryAfter), $retryAfter ); return new Th...
php
protected function buildException($key, $maxAttempts) { $retryAfter = $this->getTimeUntilNextRetry($key); $headers = $this->getHeaders( $maxAttempts, $this->calculateRemainingAttempts($key, $maxAttempts, $retryAfter), $retryAfter ); return new Th...
[ "protected", "function", "buildException", "(", "$", "key", ",", "$", "maxAttempts", ")", "{", "$", "retryAfter", "=", "$", "this", "->", "getTimeUntilNextRetry", "(", "$", "key", ")", ";", "$", "headers", "=", "$", "this", "->", "getHeaders", "(", "$", ...
Create a 'too many attempts' exception. @param string $key @param int $maxAttempts @return \Illuminate\Http\Exceptions\ThrottleRequestsException
[ "Create", "a", "too", "many", "attempts", "exception", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L114-L127
206,298
laravel/framework
src/Illuminate/Routing/Middleware/ThrottleRequests.php
ThrottleRequests.getHeaders
protected function getHeaders($maxAttempts, $remainingAttempts, $retryAfter = null) { $headers = [ 'X-RateLimit-Limit' => $maxAttempts, 'X-RateLimit-Remaining' => $remainingAttempts, ]; if (! is_null($retryAfter)) { $headers['Retry-After'] = $retryAfter; ...
php
protected function getHeaders($maxAttempts, $remainingAttempts, $retryAfter = null) { $headers = [ 'X-RateLimit-Limit' => $maxAttempts, 'X-RateLimit-Remaining' => $remainingAttempts, ]; if (! is_null($retryAfter)) { $headers['Retry-After'] = $retryAfter; ...
[ "protected", "function", "getHeaders", "(", "$", "maxAttempts", ",", "$", "remainingAttempts", ",", "$", "retryAfter", "=", "null", ")", "{", "$", "headers", "=", "[", "'X-RateLimit-Limit'", "=>", "$", "maxAttempts", ",", "'X-RateLimit-Remaining'", "=>", "$", ...
Get the limit headers information. @param int $maxAttempts @param int $remainingAttempts @param int|null $retryAfter @return array
[ "Get", "the", "limit", "headers", "information", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L166-L179
206,299
laravel/framework
src/Illuminate/Routing/Middleware/ThrottleRequests.php
ThrottleRequests.calculateRemainingAttempts
protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) { if (is_null($retryAfter)) { return $this->limiter->retriesLeft($key, $maxAttempts); } return 0; }
php
protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) { if (is_null($retryAfter)) { return $this->limiter->retriesLeft($key, $maxAttempts); } return 0; }
[ "protected", "function", "calculateRemainingAttempts", "(", "$", "key", ",", "$", "maxAttempts", ",", "$", "retryAfter", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "retryAfter", ")", ")", "{", "return", "$", "this", "->", "limiter", "->", "re...
Calculate the number of remaining attempts. @param string $key @param int $maxAttempts @param int|null $retryAfter @return int
[ "Calculate", "the", "number", "of", "remaining", "attempts", "." ]
0e0a428a50fc8378e3f77d18f3caae76c19e8c7a
https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Routing/Middleware/ThrottleRequests.php#L189-L196