idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
20,800
protected function getTokenFromRequest ( $ request ) { $ token = $ request -> input ( '_token' ) ? : $ request -> header ( 'X-CSRF-TOKEN' ) ; if ( ! $ token && $ header = $ request -> header ( 'X-XSRF-TOKEN' ) ) { $ token = $ this -> encrypter -> decrypt ( $ header , static :: serialized ( ) ) ; } return $ token ; }
Get the CSRF token from the request .
20,801
protected function createMandrillDriver ( ) { $ config = $ this -> app [ 'config' ] -> get ( 'services.mandrill' , [ ] ) ; return new MandrillTransport ( $ this -> guzzle ( $ config ) , $ config [ 'secret' ] ) ; }
Create an instance of the Mandrill Swift Transport driver .
20,802
protected function createLogDriver ( ) { $ logger = $ this -> app -> make ( LoggerInterface :: class ) ; if ( $ logger instanceof LogManager ) { $ logger = $ logger -> channel ( $ this -> app [ 'config' ] [ 'mail.log_channel' ] ) ; } return new LogTransport ( $ logger ) ; }
Create an instance of the Log Swift Transport driver .
20,803
protected function paginationInformation ( $ request ) { $ paginated = $ this -> resource -> resource -> toArray ( ) ; return [ 'links' => $ this -> paginationLinks ( $ paginated ) , 'meta' => $ this -> meta ( $ paginated ) , ] ; }
Add the pagination information to the response .
20,804
protected function paginationLinks ( $ paginated ) { return [ 'first' => $ paginated [ 'first_page_url' ] ?? null , 'last' => $ paginated [ 'last_page_url' ] ?? null , 'prev' => $ paginated [ 'prev_page_url' ] ?? null , 'next' => $ paginated [ 'next_page_url' ] ?? null , ] ; }
Get the pagination links for the response .
20,805
protected function wrap ( $ data , $ with = [ ] , $ additional = [ ] ) { if ( $ data instanceof Collection ) { $ data = $ data -> all ( ) ; } if ( $ this -> haveDefaultWrapperAndDataIsUnwrapped ( $ data ) ) { $ data = [ $ this -> wrapper ( ) => $ data ] ; } elseif ( $ this -> haveAdditionalInformationAndDataIsUnwrapped...
Wrap the given data if necessary .
20,806
protected function haveAdditionalInformationAndDataIsUnwrapped ( $ data , $ with , $ additional ) { return ( ! empty ( $ with ) || ! empty ( $ additional ) ) && ( ! $ this -> wrapper ( ) || ! array_key_exists ( $ this -> wrapper ( ) , $ data ) ) ; }
Determine if with data has been added and our data is unwrapped .
20,807
public function unless ( $ value , $ callback , $ default = null ) { if ( ! $ value ) { return $ callback ( $ this , $ value ) ? : $ this ; } elseif ( $ default ) { return $ default ( $ this , $ value ) ? : $ this ; } return $ this ; }
Apply the callback s query changes if the given value is false .
20,808
protected function simplePaginator ( $ items , $ perPage , $ currentPage , $ options ) { return Container :: getInstance ( ) -> makeWith ( Paginator :: class , compact ( 'items' , 'perPage' , 'currentPage' , 'options' ) ) ; }
Create a new simple paginator instance .
20,809
public function withoutGlobalScope ( $ scope ) { if ( ! is_string ( $ scope ) ) { $ scope = get_class ( $ scope ) ; } unset ( $ this -> scopes [ $ scope ] ) ; $ this -> removedScopes [ ] = $ scope ; return $ this ; }
Remove a registered global scope .
20,810
public function oldest ( $ column = null ) { if ( is_null ( $ column ) ) { $ column = $ this -> model -> getCreatedAtColumn ( ) ?? 'created_at' ; } $ this -> query -> oldest ( $ column ) ; return $ this ; }
Add an order by clause for a timestamp to the query .
20,811
protected function enforceOrderBy ( ) { if ( empty ( $ this -> query -> orders ) && empty ( $ this -> query -> unionOrders ) ) { $ this -> orderBy ( $ this -> model -> getQualifiedKeyName ( ) , 'asc' ) ; } }
Add a generic order by clause if the query doesn t already have one .
20,812
public function scopes ( array $ scopes ) { $ builder = $ this ; foreach ( $ scopes as $ scope => $ parameters ) { if ( is_int ( $ scope ) ) { [ $ scope , $ parameters ] = [ $ parameters , [ ] ] ; } $ builder = $ builder -> callScope ( [ $ this -> model , 'scope' . ucfirst ( $ scope ) ] , ( array ) $ parameters ) ; } r...
Call the given local model scopes .
20,813
public function without ( $ relations ) { $ this -> eagerLoad = array_diff_key ( $ this -> eagerLoad , array_flip ( is_string ( $ relations ) ? func_get_args ( ) : $ relations ) ) ; return $ this ; }
Prevent the specified relations from being eager loaded .
20,814
protected function createSelectWithConstraint ( $ name ) { return [ explode ( ':' , $ name ) [ 0 ] , function ( $ query ) use ( $ name ) { $ query -> select ( explode ( ',' , explode ( ':' , $ name ) [ 1 ] ) ) ; } ] ; }
Create a constraint to select the given columns for the relation .
20,815
public function setModel ( Model $ model ) { $ this -> model = $ model ; $ this -> query -> from ( $ model -> getTable ( ) ) ; return $ this ; }
Set a model instance for the model being queried .
20,816
public function callBeforeCallbacks ( Container $ container ) { foreach ( $ this -> beforeCallbacks as $ callback ) { $ container -> call ( $ callback ) ; } }
Call all of the before callbacks for the event .
20,817
public function sendOutputTo ( $ location , $ append = false ) { $ this -> output = $ location ; $ this -> shouldAppendOutput = $ append ; return $ this ; }
Send the output of the command to a given location .
20,818
public function emailOutputOnFailure ( $ addresses ) { $ this -> ensureOutputIsBeingCaptured ( ) ; $ addresses = Arr :: wrap ( $ addresses ) ; return $ this -> onFailure ( function ( Mailer $ mailer ) use ( $ addresses ) { $ this -> emailOutput ( $ mailer , $ addresses , false ) ; } ) ; }
E - mail the results of the scheduled operation if it fails .
20,819
protected function ensureOutputIsBeingCaptured ( ) { if ( is_null ( $ this -> output ) || $ this -> output == $ this -> getDefaultOutput ( ) ) { $ this -> sendOutputTo ( storage_path ( 'logs/schedule-' . sha1 ( $ this -> mutexName ( ) ) . '.log' ) ) ; } }
Ensure that the command output is being captured .
20,820
public function onSuccess ( Closure $ callback ) { return $ this -> then ( function ( Container $ container ) use ( $ callback ) { if ( 0 === $ this -> exitCode ) { $ container -> call ( $ callback ) ; } } ) ; }
Register a callback to be called if the operation succeeds .
20,821
public static function fake ( $ eventsToFake = [ ] ) { static :: swap ( $ fake = new EventFake ( static :: getFacadeRoot ( ) , $ eventsToFake ) ) ; Model :: setEventDispatcher ( $ fake ) ; return $ fake ; }
Replace the bound instance with a fake .
20,822
public static function fakeFor ( callable $ callable , array $ eventsToFake = [ ] ) { $ originalDispatcher = static :: getFacadeRoot ( ) ; static :: fake ( $ eventsToFake ) ; return tap ( $ callable ( ) , function ( ) use ( $ originalDispatcher ) { static :: swap ( $ originalDispatcher ) ; Model :: setEventDispatcher (...
Replace the bound instance with a fake during the given callable s execution .
20,823
public static function resolveForRoute ( $ container , $ route ) { $ parameters = $ route -> parameters ( ) ; foreach ( $ route -> signatureParameters ( UrlRoutable :: class ) as $ parameter ) { if ( ! $ parameterName = static :: getParameterName ( $ parameter -> name , $ parameters ) ) { continue ; } $ parameterValue ...
Resolve the implicit route bindings for the given route .
20,824
protected static function getParameterName ( $ name , $ parameters ) { if ( array_key_exists ( $ name , $ parameters ) ) { return $ name ; } if ( array_key_exists ( $ snakedName = Str :: snake ( $ name ) , $ parameters ) ) { return $ snakedName ; } }
Return the parameter name if it exists in the given parameters .
20,825
protected function parseCommand ( $ command , $ parameters ) { if ( is_subclass_of ( $ command , SymfonyCommand :: class ) ) { $ callingClass = true ; $ command = $ this -> laravel -> make ( $ command ) -> getName ( ) ; } if ( ! isset ( $ callingClass ) && empty ( $ parameters ) ) { $ command = $ this -> getCommandName...
Parse the incoming Artisan command and its input .
20,826
public function ignore ( $ id , $ idColumn = null ) { if ( $ id instanceof Model ) { return $ this -> ignoreModel ( $ id , $ idColumn ) ; } $ this -> ignore = $ id ; $ this -> idColumn = $ idColumn ?? 'id' ; return $ this ; }
Ignore the given ID during the unique check .
20,827
public function ignoreModel ( $ model , $ idColumn = null ) { $ this -> idColumn = $ idColumn ?? $ model -> getKeyName ( ) ; $ this -> ignore = $ model -> { $ this -> idColumn } ; return $ this ; }
Ignore the given model during the unique check .
20,828
protected function updateExistingPivotUsingCustomClass ( $ id , array $ attributes , $ touch ) { $ updated = $ this -> newPivot ( [ $ this -> foreignPivotKey => $ this -> parent -> { $ this -> parentKey } , $ this -> relatedPivotKey => $ this -> parseId ( $ id ) , ] , true ) -> fill ( $ attributes ) -> save ( ) ; if ( ...
Update an existing pivot record on the table via a custom class .
20,829
protected function attachUsingCustomClass ( $ id , array $ attributes ) { $ records = $ this -> formatAttachRecords ( $ this -> parseIds ( $ id ) , $ attributes ) ; foreach ( $ records as $ record ) { $ this -> newPivot ( $ record , false ) -> save ( ) ; } }
Attach a model to the parent using a custom class .
20,830
protected function detachUsingCustomClass ( $ ids ) { $ results = 0 ; foreach ( $ this -> parseIds ( $ ids ) as $ id ) { $ results += $ this -> newPivot ( [ $ this -> foreignPivotKey => $ this -> parent -> { $ this -> parentKey } , $ this -> relatedPivotKey => $ id , ] , true ) -> delete ( ) ; } return $ results ; }
Detach models from the relationship using a custom class .
20,831
public function withPivot ( $ columns ) { $ this -> pivotColumns = array_merge ( $ this -> pivotColumns , is_array ( $ columns ) ? $ columns : func_get_args ( ) ) ; return $ this ; }
Set the columns on the pivot table to retrieve .
20,832
protected function castAttributes ( $ attributes ) { return $ this -> using ? $ this -> newPivot ( ) -> fill ( $ attributes ) -> getAttributes ( ) : $ attributes ; }
Cast the given pivot attributes .
20,833
protected function getTypeSwapValue ( $ type , $ value ) { switch ( strtolower ( $ type ) ) { case 'int' : case 'integer' : return ( int ) $ value ; case 'real' : case 'float' : case 'double' : return ( float ) $ value ; case 'string' : return ( string ) $ value ; default : return $ value ; } }
Converts a given value to a given type value .
20,834
protected function registerLoadEvents ( $ provider , array $ events ) { if ( count ( $ events ) < 1 ) { return ; } $ this -> app -> make ( 'events' ) -> listen ( $ events , function ( ) use ( $ provider ) { $ this -> app -> register ( $ provider ) ; } ) ; }
Register the load events for the given provider .
20,835
public function where ( $ column , $ value = null ) { if ( is_array ( $ value ) ) { return $ this -> whereIn ( $ column , $ value ) ; } if ( $ column instanceof Closure ) { return $ this -> using ( $ column ) ; } $ this -> wheres [ ] = compact ( 'column' , 'value' ) ; return $ this ; }
Set a where constraint on the query .
20,836
public function whereNot ( $ column , $ value ) { if ( is_array ( $ value ) ) { return $ this -> whereNotIn ( $ column , $ value ) ; } return $ this -> where ( $ column , '!' . $ value ) ; }
Set a where not constraint on the query .
20,837
public function whereIn ( $ column , array $ values ) { return $ this -> where ( function ( $ query ) use ( $ column , $ values ) { $ query -> whereIn ( $ column , $ values ) ; } ) ; }
Set a where in constraint on the query .
20,838
public function whereNotIn ( $ column , array $ values ) { return $ this -> where ( function ( $ query ) use ( $ column , $ values ) { $ query -> whereNotIn ( $ column , $ values ) ; } ) ; }
Set a where not in constraint on the query .
20,839
protected function refreshPdoConnections ( $ name ) { $ fresh = $ this -> makeConnection ( $ name ) ; return $ this -> connections [ $ name ] -> setPdo ( $ fresh -> getPdo ( ) ) -> setReadPdo ( $ fresh -> getReadPdo ( ) ) ; }
Refresh the PDO connections on a given connection .
20,840
public function old ( $ key = null , $ default = null ) { return $ this -> hasSession ( ) ? $ this -> session ( ) -> getOldInput ( $ key , $ default ) : $ default ; }
Retrieve an old input item .
20,841
protected function storePasswordHashInSession ( $ request ) { if ( ! $ request -> user ( ) ) { return ; } $ request -> session ( ) -> put ( [ 'password_hash' => $ request -> user ( ) -> getAuthPassword ( ) , ] ) ; }
Store the user s current password hash in the session .
20,842
protected function buildRouteCacheFile ( RouteCollection $ routes ) { $ stub = $ this -> files -> get ( __DIR__ . '/stubs/routes.stub' ) ; return str_replace ( '{{routes}}' , base64_encode ( serialize ( $ routes ) ) , $ stub ) ; }
Build the route cache file .
20,843
public function handle ( $ request , Closure $ next , $ options = [ ] ) { $ response = $ next ( $ request ) ; if ( ! $ request -> isMethodCacheable ( ) || ! $ response -> getContent ( ) ) { return $ response ; } if ( is_string ( $ options ) ) { $ options = $ this -> parseOptions ( $ options ) ; } if ( isset ( $ options...
Add cache related HTTP headers .
20,844
protected function parseOptions ( $ options ) { return collect ( explode ( ';' , $ options ) ) -> mapWithKeys ( function ( $ option ) { $ data = explode ( '=' , $ option , 2 ) ; return [ $ data [ 0 ] => $ data [ 1 ] ?? true ] ; } ) -> all ( ) ; }
Parse the given header options .
20,845
protected static function updatePackageArray ( array $ packages ) { unset ( $ packages [ 'bootstrap' ] , $ packages [ 'jquery' ] , $ packages [ 'popper.js' ] , $ packages [ 'vue' ] , $ packages [ 'vue-template-compiler' ] , $ packages [ '@babel/preset-react' ] , $ packages [ 'react' ] , $ packages [ 'react-dom' ] ) ; r...
Update the given package array .
20,846
public function redirect ( $ uri , $ destination , $ status = 302 ) { return $ this -> any ( $ uri , '\Illuminate\Routing\RedirectController' ) -> defaults ( 'destination' , $ destination ) -> defaults ( 'status' , $ status ) ; }
Create a redirect from one URI to another .
20,847
public function view ( $ uri , $ view , $ data = [ ] ) { return $ this -> match ( [ 'GET' , 'HEAD' ] , $ uri , '\Illuminate\Routing\ViewController' ) -> defaults ( 'view' , $ view ) -> defaults ( 'data' , $ data ) ; }
Register a new route that returns a view .
20,848
public function apiResources ( array $ resources , array $ options = [ ] ) { foreach ( $ resources as $ name => $ controller ) { $ this -> apiResource ( $ name , $ controller , $ options ) ; } }
Register an array of API resource controllers .
20,849
public function apiResource ( $ name , $ controller , array $ options = [ ] ) { $ only = [ 'index' , 'show' , 'store' , 'update' , 'destroy' ] ; if ( isset ( $ options [ 'except' ] ) ) { $ only = array_diff ( $ only , ( array ) $ options [ 'except' ] ) ; } return $ this -> resource ( $ name , $ controller , array_merge...
Route an API resource to a controller .
20,850
protected function loadRoutes ( $ routes ) { if ( $ routes instanceof Closure ) { $ routes ( $ this ) ; } else { ( new RouteFileRegistrar ( $ this ) ) -> register ( $ routes ) ; } }
Load the provided routes .
20,851
public function respondWithRoute ( $ name ) { $ route = tap ( $ this -> routes -> getByName ( $ name ) ) -> bind ( $ this -> currentRequest ) ; return $ this -> runRoute ( $ this -> currentRequest , $ route ) ; }
Return the response returned by the given route .
20,852
protected function runRoute ( Request $ request , Route $ route ) { $ request -> setRouteResolver ( function ( ) use ( $ route ) { return $ route ; } ) ; $ this -> events -> dispatch ( new Events \ RouteMatched ( $ route , $ request ) ) ; return $ this -> prepareResponse ( $ request , $ this -> runRouteWithinStack ( $ ...
Return the response for the given route .
20,853
public function gatherRouteMiddleware ( Route $ route ) { $ middleware = collect ( $ route -> gatherMiddleware ( ) ) -> map ( function ( $ name ) { return ( array ) MiddlewareNameResolver :: resolve ( $ name , $ this -> middleware , $ this -> middlewareGroups ) ; } ) -> flatten ( ) ; return $ this -> sortMiddleware ( $...
Gather the middleware for the given route with resolved class names .
20,854
public function prependMiddlewareToGroup ( $ group , $ middleware ) { if ( isset ( $ this -> middlewareGroups [ $ group ] ) && ! in_array ( $ middleware , $ this -> middlewareGroups [ $ group ] ) ) { array_unshift ( $ this -> middlewareGroups [ $ group ] , $ middleware ) ; } return $ this ; }
Add a middleware to the beginning of a middleware group .
20,855
public function getBindingCallback ( $ key ) { if ( isset ( $ this -> binders [ $ key = str_replace ( '-' , '_' , $ key ) ] ) ) { return $ this -> binders [ $ key ] ; } }
Get the binding callback for a given binding .
20,856
public function patterns ( $ patterns ) { foreach ( $ patterns as $ key => $ pattern ) { $ this -> pattern ( $ key , $ pattern ) ; } }
Set a group of global where patterns on all routes .
20,857
public function has ( $ name ) { $ names = is_array ( $ name ) ? $ name : func_get_args ( ) ; foreach ( $ names as $ value ) { if ( ! $ this -> routes -> hasNamedRoute ( $ value ) ) { return false ; } } return true ; }
Check if a route with the given name exists .
20,858
public function resetPassword ( ) { $ this -> get ( 'password/reset' , 'Auth\ForgotPasswordController@showLinkRequestForm' ) -> name ( 'password.request' ) ; $ this -> post ( 'password/email' , 'Auth\ForgotPasswordController@sendResetLinkEmail' ) -> name ( 'password.email' ) ; $ this -> get ( 'password/reset/{token}' ,...
Register the typical reset password routes for an application .
20,859
public function emailVerification ( ) { $ this -> get ( 'email/verify' , 'Auth\VerificationController@show' ) -> name ( 'verification.notice' ) ; $ this -> get ( 'email/verify/{id}' , 'Auth\VerificationController@verify' ) -> name ( 'verification.verify' ) ; $ this -> get ( 'email/resend' , 'Auth\VerificationController...
Register the typical email verification routes for an application .
20,860
protected function sortRoutes ( $ sort , array $ routes ) { return Arr :: sort ( $ routes , function ( $ route ) use ( $ sort ) { return $ route [ $ sort ] ; } ) ; }
Sort the routes by a given element .
20,861
protected function pluckColumns ( array $ routes ) { return array_map ( function ( $ route ) { return Arr :: only ( $ route , $ this -> getColumns ( ) ) ; } , $ routes ) ; }
Remove unnecessary columns from the routes .
20,862
protected function newQueryForCollectionRestoration ( array $ ids ) { if ( ! Str :: contains ( $ ids [ 0 ] , ':' ) ) { return parent :: newQueryForRestoration ( $ ids ) ; } $ query = $ this -> newQueryWithoutScopes ( ) ; foreach ( $ ids as $ id ) { $ segments = explode ( ':' , $ id ) ; $ query -> orWhere ( function ( $...
Get a new query to restore multiple models by their queueable IDs .
20,863
protected function migrate ( $ queue ) { $ this -> migrateExpiredJobs ( $ queue . ':delayed' , $ queue ) ; if ( ! is_null ( $ this -> retryAfter ) ) { $ this -> migrateExpiredJobs ( $ queue . ':reserved' , $ queue ) ; } }
Migrate any delayed or expired jobs onto the primary queue .
20,864
public function exists ( ... $ keys ) { $ keys = collect ( $ keys ) -> map ( function ( $ key ) { return $ this -> applyPrefix ( $ key ) ; } ) -> all ( ) ; return $ this -> executeRaw ( array_merge ( [ 'exists' ] , $ keys ) ) ; }
Determine if the given keys exist .
20,865
public function hmset ( $ key , ... $ dictionary ) { if ( count ( $ dictionary ) === 1 ) { $ dictionary = $ dictionary [ 0 ] ; } else { $ input = collect ( $ dictionary ) ; $ dictionary = $ input -> nth ( 2 ) -> combine ( $ input -> nth ( 2 , 1 ) ) -> toArray ( ) ; } return $ this -> command ( 'hmset' , [ $ key , $ dic...
Set the given hash fields to their respective values .
20,866
public function blpop ( ... $ arguments ) { $ result = $ this -> command ( 'blpop' , $ arguments ) ; return empty ( $ result ) ? null : $ result ; }
Removes and returns the first element of the list stored at key .
20,867
public function brpop ( ... $ arguments ) { $ result = $ this -> command ( 'brpop' , $ arguments ) ; return empty ( $ result ) ? null : $ result ; }
Removes and returns the last element of the list stored at key .
20,868
public function pipeline ( callable $ callback = null ) { $ pipeline = $ this -> client ( ) -> pipeline ( ) ; return is_null ( $ callback ) ? $ pipeline : tap ( $ pipeline , $ callback ) -> exec ( ) ; }
Execute commands in a pipeline .
20,869
public function evalsha ( $ script , $ numkeys , ... $ arguments ) { return $ this -> command ( 'evalsha' , [ $ this -> script ( 'load' , $ script ) , $ arguments , $ numkeys , ] ) ; }
Evaluate a LUA script serverside from the SHA1 hash of the script instead of the script itself .
20,870
private function applyPrefix ( $ key ) { $ prefix = ( string ) $ this -> client -> getOption ( Redis :: OPT_PREFIX ) ; return $ prefix . $ key ; }
Apply prefix to the given key if necessary .
20,871
public function compileSpatialIndex ( Blueprint $ blueprint , Fluent $ command ) { $ command -> algorithm = 'gist' ; return $ this -> compileIndex ( $ blueprint , $ command ) ; }
Compile a spatial index key command .
20,872
public function compileRename ( Blueprint $ blueprint , Fluent $ command ) { $ from = $ this -> wrapTable ( $ blueprint ) ; return "alter table {$from} rename to " . $ this -> wrapTable ( $ command -> to ) ; }
Compile a rename table command .
20,873
public function compileComment ( Blueprint $ blueprint , Fluent $ command ) { return sprintf ( 'comment on column %s.%s is %s' , $ this -> wrapTable ( $ blueprint ) , $ this -> wrap ( $ command -> column -> name ) , "'" . str_replace ( "'" , "''" , $ command -> value ) . "'" ) ; }
Compile a comment command .
20,874
protected function generatableColumn ( $ type , Fluent $ column ) { if ( ! $ column -> autoIncrement && is_null ( $ column -> generatedAs ) ) { return $ type ; } if ( $ column -> autoIncrement && is_null ( $ column -> generatedAs ) ) { return with ( [ 'integer' => 'serial' , 'bigint' => 'bigserial' , 'smallint' => 'sma...
Create the column definition for a generatable column .
20,875
protected function modifyDefault ( Blueprint $ blueprint , Fluent $ column ) { if ( ! is_null ( $ column -> default ) ) { return ' default ' . $ this -> getDefaultValue ( $ column -> default ) ; } }
Get the SQL for a default column modifier .
20,876
protected function modifyIncrement ( Blueprint $ blueprint , Fluent $ column ) { if ( ( in_array ( $ column -> type , $ this -> serials ) || ( $ column -> generatedAs !== null ) ) && $ column -> autoIncrement ) { return ' primary key' ; } }
Get the SQL for an auto - increment column modifier .
20,877
protected function setGlobalAddress ( $ mailer , array $ config , $ type ) { $ address = Arr :: get ( $ config , $ type ) ; if ( is_array ( $ address ) && isset ( $ address [ 'address' ] ) ) { $ mailer -> { 'always' . Str :: studly ( $ type ) } ( $ address [ 'address' ] , $ address [ 'name' ] ) ; } }
Set a global address on the mailer by type .
20,878
protected function ensureCommandsAreValid ( Connection $ connection ) { if ( $ connection instanceof SQLiteConnection ) { if ( $ this -> commandsNamed ( [ 'dropColumn' , 'renameColumn' ] ) -> count ( ) > 1 ) { throw new BadMethodCallException ( "SQLite doesn't support multiple calls to dropColumn / renameColumn in a si...
Ensure the commands on the blueprint are valid for the connection type .
20,879
protected function commandsNamed ( array $ names ) { return collect ( $ this -> commands ) -> filter ( function ( $ command ) use ( $ names ) { return in_array ( $ command -> name , $ names ) ; } ) ; }
Get all of the commands matching the given names .
20,880
public function addFluentCommands ( Grammar $ grammar ) { foreach ( $ this -> columns as $ column ) { foreach ( $ grammar -> getFluentCommands ( ) as $ commandName ) { $ attributeName = lcfirst ( $ commandName ) ; if ( ! isset ( $ column -> { $ attributeName } ) ) { continue ; } $ value = $ column -> { $ attributeName ...
Add the fluent commands specified on any columns .
20,881
public function dropColumn ( $ columns ) { $ columns = is_array ( $ columns ) ? $ columns : func_get_args ( ) ; return $ this -> addCommand ( 'dropColumn' , compact ( 'columns' ) ) ; }
Indicate that the given columns should be dropped .
20,882
public function dropMorphs ( $ name , $ indexName = null ) { $ this -> dropIndex ( $ indexName ? : $ this -> createIndexName ( 'index' , [ "{$name}_type" , "{$name}_id" ] ) ) ; $ this -> dropColumn ( "{$name}_type" , "{$name}_id" ) ; }
Indicate that the polymorphic columns should be dropped .
20,883
public function char ( $ column , $ length = null ) { $ length = $ length ? : Builder :: $ defaultStringLength ; return $ this -> addColumn ( 'char' , $ column , compact ( 'length' ) ) ; }
Create a new char column on the table .
20,884
public function double ( $ column , $ total = null , $ places = null ) { return $ this -> addColumn ( 'double' , $ column , compact ( 'total' , 'places' ) ) ; }
Create a new double column on the table .
20,885
public function unsignedDecimal ( $ column , $ total = 8 , $ places = 2 ) { return $ this -> addColumn ( 'decimal' , $ column , [ 'total' => $ total , 'places' => $ places , 'unsigned' => true , ] ) ; }
Create a new unsigned decimal column on the table .
20,886
public function timestampsTz ( $ precision = 0 ) { $ this -> timestampTz ( 'created_at' , $ precision ) -> nullable ( ) ; $ this -> timestampTz ( 'updated_at' , $ precision ) -> nullable ( ) ; }
Add creation and update timestampTz columns to the table .
20,887
public function morphs ( $ name , $ indexName = null ) { $ this -> string ( "{$name}_type" ) ; $ this -> unsignedBigInteger ( "{$name}_id" ) ; $ this -> index ( [ "{$name}_type" , "{$name}_id" ] , $ indexName ) ; }
Add the proper columns for a polymorphic table .
20,888
protected function discoveredEvents ( ) { if ( $ this -> app -> eventsAreCached ( ) ) { return require $ this -> app -> getCachedEventsPath ( ) ; } return $ this -> shouldDiscoverEvents ( ) ? $ this -> discoverEvents ( ) : [ ] ; }
Get the discovered events and listeners for the application .
20,889
public function to ( $ route , $ parameters = [ ] , $ absolute = false ) { $ domain = $ this -> getRouteDomain ( $ route , $ parameters ) ; $ uri = $ this -> addQueryString ( $ this -> url -> format ( $ root = $ this -> replaceRootParameters ( $ route , $ domain , $ parameters ) , $ this -> replaceRouteParameters ( $ r...
Generate a URL for the given route .
20,890
protected function formatDomain ( $ route , & $ parameters ) { return $ this -> addPortToDomain ( $ this -> getRouteScheme ( $ route ) . $ route -> getDomain ( ) ) ; }
Format the domain and port for the route and request .
20,891
public function confirmToProceed ( $ warning = 'Application In Production!' , $ callback = null ) { $ callback = is_null ( $ callback ) ? $ this -> getDefaultConfirmCallback ( ) : $ callback ; $ shouldConfirm = $ callback instanceof Closure ? call_user_func ( $ callback ) : $ callback ; if ( $ shouldConfirm ) { if ( $ ...
Confirm before proceeding with the action .
20,892
public static function bulk ( $ jobs , $ data = '' , $ queue = null , $ connection = null ) { return static :: $ instance -> connection ( $ connection ) -> bulk ( $ jobs , $ data , $ queue ) ; }
Push a new an array of jobs onto the queue .
20,893
protected function getRedirectUrl ( ) { $ url = $ this -> redirector -> getUrlGenerator ( ) ; if ( $ this -> redirect ) { return $ url -> to ( $ this -> redirect ) ; } elseif ( $ this -> redirectRoute ) { return $ url -> route ( $ this -> redirectRoute ) ; } elseif ( $ this -> redirectAction ) { return $ url -> action ...
Get the URL to redirect to on a validation error .
20,894
public static function collection ( $ resource ) { return tap ( new AnonymousResourceCollection ( $ resource , static :: class ) , function ( $ collection ) { if ( property_exists ( static :: class , 'preserveKeys' ) ) { $ collection -> preserveKeys = ( new static ( [ ] ) ) -> preserveKeys === true ; } } ) ; }
Create new anonymous resource collection .
20,895
public static function in ( $ values ) { if ( $ values instanceof Arrayable ) { $ values = $ values -> toArray ( ) ; } return new Rules \ In ( is_array ( $ values ) ? $ values : func_get_args ( ) ) ; }
Get an in constraint builder instance .
20,896
public static function notIn ( $ values ) { if ( $ values instanceof Arrayable ) { $ values = $ values -> toArray ( ) ; } return new Rules \ NotIn ( is_array ( $ values ) ? $ values : func_get_args ( ) ) ; }
Get a not_in constraint builder instance .
20,897
public function pipe ( $ object , $ pipeline = null ) { $ pipeline = $ pipeline ? : 'default' ; return call_user_func ( $ this -> pipelines [ $ pipeline ] , new Pipeline ( $ this -> container ) , $ object ) ; }
Send an object through one of the available pipelines .
20,898
protected function createClient ( array $ config ) { return tap ( new Redis , function ( $ client ) use ( $ config ) { $ this -> establishConnection ( $ client , $ config ) ; if ( ! empty ( $ config [ 'password' ] ) ) { $ client -> auth ( $ config [ 'password' ] ) ; } if ( ! empty ( $ config [ 'database' ] ) ) { $ clie...
Create the Redis client instance .
20,899
protected function loadMigrationsFrom ( $ paths ) { $ this -> app -> afterResolving ( 'migrator' , function ( $ migrator ) use ( $ paths ) { foreach ( ( array ) $ paths as $ path ) { $ migrator -> path ( $ path ) ; } } ) ; }
Register a database migration path .