idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
21,300 | protected function compileUpdateColumns ( $ values ) { return collect ( $ values ) -> map ( function ( $ value , $ key ) { if ( $ this -> isJsonSelector ( $ key ) ) { return $ this -> compileJsonUpdateColumn ( $ key , new JsonExpression ( $ value ) ) ; } return $ this -> wrap ( $ key ) . ' = ' . $ this -> parameter ( $... | Compile all of the columns for an update statement . |
21,301 | public function send ( MailerContract $ mailer ) { return $ this -> withLocale ( $ this -> locale , function ( ) use ( $ mailer ) { Container :: getInstance ( ) -> call ( [ $ this , 'build' ] ) ; return $ mailer -> send ( $ this -> buildView ( ) , $ this -> buildViewData ( ) , function ( $ message ) { $ this -> buildFr... | Send the message using the given mailer . |
21,302 | public function queue ( Queue $ queue ) { if ( isset ( $ this -> delay ) ) { return $ this -> later ( $ this -> delay , $ queue ) ; } $ connection = property_exists ( $ this , 'connection' ) ? $ this -> connection : null ; $ queueName = property_exists ( $ this , 'queue' ) ? $ this -> queue : null ; return $ queue -> c... | Queue the message for sending . |
21,303 | public function render ( ) { return $ this -> withLocale ( $ this -> locale , function ( ) { Container :: getInstance ( ) -> call ( [ $ this , 'build' ] ) ; return Container :: getInstance ( ) -> make ( 'mailer' ) -> render ( $ this -> buildView ( ) , $ this -> buildViewData ( ) ) ; } ) ; } | Render the mailable into a view . |
21,304 | protected function buildView ( ) { if ( isset ( $ this -> html ) ) { return array_filter ( [ 'html' => new HtmlString ( $ this -> html ) , 'text' => $ this -> textView ?? null , ] ) ; } if ( isset ( $ this -> markdown ) ) { return $ this -> buildMarkdownView ( ) ; } if ( isset ( $ this -> view , $ this -> textView ) ) ... | Build the view for the message . |
21,305 | protected function buildMarkdownView ( ) { $ markdown = Container :: getInstance ( ) -> make ( Markdown :: class ) ; if ( isset ( $ this -> theme ) ) { $ markdown -> theme ( $ this -> theme ) ; } $ data = $ this -> buildViewData ( ) ; return [ 'html' => $ markdown -> render ( $ this -> markdown , $ data ) , 'text' => $... | Build the Markdown view for the message . |
21,306 | public function buildViewData ( ) { $ data = $ this -> viewData ; if ( static :: $ viewDataCallback ) { $ data = array_merge ( $ data , call_user_func ( static :: $ viewDataCallback , $ this ) ) ; } foreach ( ( new ReflectionClass ( $ this ) ) -> getProperties ( ReflectionProperty :: IS_PUBLIC ) as $ property ) { if ( ... | Build the view data for the message . |
21,307 | protected function buildMarkdownText ( $ markdown , $ data ) { return $ this -> textView ?? $ markdown -> renderText ( $ this -> markdown , $ data ) ; } | Build the text view for a Markdown message . |
21,308 | protected function buildFrom ( $ message ) { if ( ! empty ( $ this -> from ) ) { $ message -> from ( $ this -> from [ 0 ] [ 'address' ] , $ this -> from [ 0 ] [ 'name' ] ) ; } return $ this ; } | Add the sender to the message . |
21,309 | protected function buildRecipients ( $ message ) { foreach ( [ 'to' , 'cc' , 'bcc' , 'replyTo' ] as $ type ) { foreach ( $ this -> { $ type } as $ recipient ) { $ message -> { $ type } ( $ recipient [ 'address' ] , $ recipient [ 'name' ] ) ; } } return $ this ; } | Add all of the recipients to the message . |
21,310 | protected function buildSubject ( $ message ) { if ( $ this -> subject ) { $ message -> subject ( $ this -> subject ) ; } else { $ message -> subject ( Str :: title ( Str :: snake ( class_basename ( $ this ) , ' ' ) ) ) ; } return $ this ; } | Set the subject for the message . |
21,311 | protected function buildAttachments ( $ message ) { foreach ( $ this -> attachments as $ attachment ) { $ message -> attach ( $ attachment [ 'file' ] , $ attachment [ 'options' ] ) ; } foreach ( $ this -> rawAttachments as $ attachment ) { $ message -> attachData ( $ attachment [ 'data' ] , $ attachment [ 'name' ] , $ ... | Add all of the attachments to the message . |
21,312 | protected function buildDiskAttachments ( $ message ) { foreach ( $ this -> diskAttachments as $ attachment ) { $ storage = Container :: getInstance ( ) -> make ( FilesystemFactory :: class ) -> disk ( $ attachment [ 'disk' ] ) ; $ message -> attachData ( $ storage -> get ( $ attachment [ 'path' ] ) , $ attachment [ 'n... | Add all of the disk attachments to the message . |
21,313 | protected function runCallbacks ( $ message ) { foreach ( $ this -> callbacks as $ callback ) { $ callback ( $ message -> getSwiftMessage ( ) ) ; } return $ this ; } | Run the callbacks for the message . |
21,314 | protected function addressesToArray ( $ address , $ name ) { if ( ! is_array ( $ address ) && ! $ address instanceof Collection ) { $ address = is_string ( $ name ) ? [ [ 'name' => $ name , 'email' => $ address ] ] : [ $ address ] ; } return $ address ; } | Convert the given recipient arguments to an array . |
21,315 | protected function normalizeRecipient ( $ recipient ) { if ( is_array ( $ recipient ) ) { return ( object ) $ recipient ; } elseif ( is_string ( $ recipient ) ) { return ( object ) [ 'email' => $ recipient ] ; } return $ recipient ; } | Convert the given recipient into an object . |
21,316 | protected function hasRecipient ( $ address , $ name = null , $ property = 'to' ) { $ expected = $ this -> normalizeRecipient ( $ this -> addressesToArray ( $ address , $ name ) [ 0 ] ) ; $ expected = [ 'name' => $ expected -> name ?? null , 'address' => $ expected -> email , ] ; return collect ( $ this -> { $ property... | Determine if the given recipient is set on the mailable . |
21,317 | public function text ( $ textView , array $ data = [ ] ) { $ this -> textView = $ textView ; $ this -> viewData = array_merge ( $ this -> viewData , $ data ) ; return $ this ; } | Set the plain text view for the message . |
21,318 | public function with ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { $ this -> viewData = array_merge ( $ this -> viewData , $ key ) ; } else { $ this -> viewData [ $ key ] = $ value ; } return $ this ; } | Set the view data for the message . |
21,319 | public function getResourceWildcard ( $ value ) { if ( isset ( $ this -> parameters [ $ value ] ) ) { $ value = $ this -> parameters [ $ value ] ; } elseif ( isset ( static :: $ parameterMap [ $ value ] ) ) { $ value = static :: $ parameterMap [ $ value ] ; } elseif ( $ this -> parameters === 'singular' || static :: $ ... | Format a resource parameter for usage . |
21,320 | public function authenticate ( Request $ request ) { if ( $ request -> hasSession ( ) ) { $ request -> session ( ) -> reflash ( ) ; } return Broadcast :: auth ( $ request ) ; } | Authenticate the request for channel access . |
21,321 | public function process ( $ connectionName , $ job , WorkerOptions $ options ) { try { $ this -> raiseBeforeJobEvent ( $ connectionName , $ job ) ; $ this -> markJobAsFailedIfAlreadyExceedsMaxAttempts ( $ connectionName , $ job , ( int ) $ options -> maxTries ) ; $ job -> fire ( ) ; $ this -> raiseAfterJobEvent ( $ con... | Process the given job from the queue . |
21,322 | protected function listenForSignals ( ) { pcntl_async_signals ( true ) ; pcntl_signal ( SIGTERM , function ( ) { $ this -> shouldQuit = true ; } ) ; pcntl_signal ( SIGUSR2 , function ( ) { $ this -> paused = true ; } ) ; pcntl_signal ( SIGCONT , function ( ) { $ this -> paused = false ; } ) ; } | Enable async signals for the process . |
21,323 | public function stop ( $ status = 0 ) { $ this -> events -> dispatch ( new Events \ WorkerStopping ( $ status ) ) ; exit ( $ status ) ; } | Stop listening and bail out of the script . |
21,324 | protected function dispatchToRouter ( ) { return function ( $ request ) { $ this -> app -> instance ( 'request' , $ request ) ; return $ this -> router -> dispatch ( $ request ) ; } ; } | Get the route dispatcher callback . |
21,325 | public function prependMiddleware ( $ middleware ) { if ( array_search ( $ middleware , $ this -> middleware ) === false ) { array_unshift ( $ this -> middleware , $ middleware ) ; } return $ this ; } | Add a new middleware to beginning of the stack if it does not already exist . |
21,326 | public function validate ( array $ data , array $ rules , array $ messages = [ ] , array $ customAttributes = [ ] ) { return $ this -> make ( $ data , $ rules , $ messages , $ customAttributes ) -> validate ( ) ; } | Validate the given data against the provided rules . |
21,327 | public static function parse ( $ uri , $ action ) { if ( is_null ( $ action ) ) { return static :: missingAction ( $ uri ) ; } if ( is_callable ( $ action , true ) ) { return ! is_array ( $ action ) ? [ 'uses' => $ action ] : [ 'uses' => $ action [ 0 ] . '@' . $ action [ 1 ] , 'controller' => $ action [ 0 ] . '@' . $ a... | Parse the given action into an array . |
21,328 | protected function buildHostString ( array $ config , $ separator ) { if ( isset ( $ config [ 'port' ] ) && ! empty ( $ config [ 'port' ] ) ) { return $ config [ 'host' ] . $ separator . $ config [ 'port' ] ; } else { return $ config [ 'host' ] ; } } | Build a host string from the given configuration . |
21,329 | protected function whereDate ( Builder $ query , $ where ) { $ value = $ this -> parameter ( $ where [ 'value' ] ) ; return 'cast(' . $ this -> wrap ( $ where [ 'column' ] ) . ' as date) ' . $ where [ 'operator' ] . ' ' . $ value ; } | Compile a where date clause . |
21,330 | protected function unserialize ( $ value ) { if ( $ this -> connection instanceof PostgresConnection && ! Str :: contains ( $ value , [ ':' , ';' ] ) ) { $ value = base64_decode ( $ value ) ; } return unserialize ( $ value ) ; } | Unserialize the given value . |
21,331 | public function store ( $ name = null ) { $ name = $ name ? : $ this -> getDefaultDriver ( ) ; return $ this -> stores [ $ name ] = $ this -> get ( $ name ) ; } | Get a cache store instance by name wrapped in a repository . |
21,332 | protected function createApcDriver ( array $ config ) { $ prefix = $ this -> getPrefix ( $ config ) ; return $ this -> repository ( new ApcStore ( new ApcWrapper , $ prefix ) ) ; } | Create an instance of the APC cache driver . |
21,333 | protected function createDynamodbDriver ( array $ config ) { $ dynamoConfig = [ 'region' => $ config [ 'region' ] , 'version' => 'latest' , ] ; if ( $ config [ 'key' ] && $ config [ 'secret' ] ) { $ dynamoConfig [ 'credentials' ] = Arr :: only ( $ config , [ 'key' , 'secret' , 'token' ] ) ; } return $ this -> repositor... | Create an instance of the DynamoDB cache driver . |
21,334 | public function forgetDriver ( $ name = null ) { $ name = $ name ?? $ this -> getDefaultDriver ( ) ; foreach ( ( array ) $ name as $ cacheName ) { if ( isset ( $ this -> stores [ $ cacheName ] ) ) { unset ( $ this -> stores [ $ cacheName ] ) ; } } return $ this ; } | Unset the given driver instances . |
21,335 | public function register ( $ engine , Closure $ resolver ) { unset ( $ this -> resolved [ $ engine ] ) ; $ this -> resolvers [ $ engine ] = $ resolver ; } | Register a new engine resolver . |
21,336 | public function resolve ( $ engine ) { if ( isset ( $ this -> resolved [ $ engine ] ) ) { return $ this -> resolved [ $ engine ] ; } if ( isset ( $ this -> resolvers [ $ engine ] ) ) { return $ this -> resolved [ $ engine ] = call_user_func ( $ this -> resolvers [ $ engine ] ) ; } throw new InvalidArgumentException ( "... | Resolve an engine instance by name . |
21,337 | public function render ( $ view , array $ data = [ ] ) { [ $ view , $ plain , $ raw ] = $ this -> parseView ( $ view ) ; $ data [ 'message' ] = $ this -> createMessage ( ) ; return $ this -> renderView ( $ view ? : $ plain , $ data ) ; } | Render the given message as a view . |
21,338 | protected function sendMailable ( MailableContract $ mailable ) { return $ mailable instanceof ShouldQueue ? $ mailable -> queue ( $ this -> queue ) : $ mailable -> send ( $ this ) ; } | Send the given mailable . |
21,339 | protected function setGlobalToAndRemoveCcAndBcc ( $ message ) { $ message -> to ( $ this -> to [ 'address' ] , $ this -> to [ 'name' ] , true ) ; $ message -> cc ( null , null , true ) ; $ message -> bcc ( null , null , true ) ; } | Set the global to address on the given message . |
21,340 | protected function shouldSendMessage ( $ message , $ data = [ ] ) { if ( ! $ this -> events ) { return true ; } return $ this -> events -> until ( new Events \ MessageSending ( $ message , $ data ) ) !== false ; } | Determines if the message can be sent . |
21,341 | protected function dispatchSentEvent ( $ message , $ data = [ ] ) { if ( $ this -> events ) { $ this -> events -> dispatch ( new Events \ MessageSent ( $ message -> getSwiftMessage ( ) , $ data ) ) ; } } | Dispatch the message sent event . |
21,342 | public function action ( $ text , $ url ) { $ this -> actionText = $ text ; $ this -> actionUrl = $ url ; return $ this ; } | Configure the call to action button . |
21,343 | public function toArray ( ) { return [ 'level' => $ this -> level , 'subject' => $ this -> subject , 'greeting' => $ this -> greeting , 'salutation' => $ this -> salutation , 'introLines' => $ this -> introLines , 'outroLines' => $ this -> outroLines , 'actionText' => $ this -> actionText , 'actionUrl' => $ this -> act... | Get an array representation of the message . |
21,344 | public static function guess ( $ migration ) { foreach ( self :: CREATE_PATTERNS as $ pattern ) { if ( preg_match ( $ pattern , $ migration , $ matches ) ) { return [ $ matches [ 1 ] , $ create = true ] ; } } foreach ( self :: CHANGE_PATTERNS as $ pattern ) { if ( preg_match ( $ pattern , $ migration , $ matches ) ) { ... | Attempt to guess the table name and creation status of the given migration . |
21,345 | public function getAdjacentUrlRange ( $ onEachSide ) { return $ this -> paginator -> getUrlRange ( $ this -> currentPage ( ) - $ onEachSide , $ this -> currentPage ( ) + $ onEachSide ) ; } | Get the page range for the current page window . |
21,346 | public static function persistentFake ( $ disk = null ) { $ disk = $ disk ? : self :: $ app [ 'config' ] -> get ( 'filesystems.default' ) ; static :: set ( $ disk , $ fake = self :: createLocalDriver ( [ 'root' => storage_path ( 'framework/testing/disks/' . $ disk ) , ] ) ) ; return $ fake ; } | Replace the given disk with a persistent local testing disk . |
21,347 | public function getUrlRange ( $ start , $ end ) { return collect ( range ( $ start , $ end ) ) -> mapWithKeys ( function ( $ page ) { return [ $ page => $ this -> url ( $ page ) ] ; } ) -> all ( ) ; } | Create a range of pagination URLs . |
21,348 | protected function appendArray ( array $ keys ) { foreach ( $ keys as $ key => $ value ) { $ this -> addQuery ( $ key , $ value ) ; } return $ this ; } | Add an array of query string values . |
21,349 | protected function addQuery ( $ key , $ value ) { if ( $ key !== $ this -> pageName ) { $ this -> query [ $ key ] = $ value ; } return $ this ; } | Add a query string value to the paginator . |
21,350 | protected function hasAllSegments ( ) { $ segments = explode ( '|' , $ this -> recaller ) ; return count ( $ segments ) === 3 && trim ( $ segments [ 0 ] ) !== '' && trim ( $ segments [ 1 ] ) !== '' ; } | Determine if the recaller has all segments . |
21,351 | protected function removeMissingValues ( $ data ) { $ numericKeys = true ; foreach ( $ data as $ key => $ value ) { if ( ( $ value instanceof PotentiallyMissing && $ value -> isMissing ( ) ) || ( $ value instanceof self && $ value -> resource instanceof PotentiallyMissing && $ value -> isMissing ( ) ) ) { unset ( $ dat... | Remove the missing values from the filtered data . |
21,352 | protected function whenPivotLoadedAs ( $ accessor , $ table , $ value , $ default = null ) { if ( func_num_args ( ) === 3 ) { $ default = new MissingValue ; } return $ this -> when ( $ this -> resource -> $ accessor && ( $ this -> resource -> $ accessor instanceof $ table || $ this -> resource -> $ accessor -> getTable... | Execute a callback if the given pivot table with a custom accessor has been loaded . |
21,353 | public function restoreModel ( $ value ) { return $ this -> getQueryForModelRestoration ( ( new $ value -> class ) -> setConnection ( $ value -> connection ) , $ value -> id ) -> useWritePdo ( ) -> firstOrFail ( ) -> load ( $ value -> relations ?? [ ] ) ; } | Restore the model from the model identifier instance . |
21,354 | public function cloud ( ) { $ name = $ this -> getDefaultCloudDriver ( ) ; return $ this -> disks [ $ name ] = $ this -> get ( $ name ) ; } | Get a default cloud filesystem instance . |
21,355 | public static function times ( $ number , callable $ callback = null ) { if ( $ number < 1 ) { return new static ; } if ( is_null ( $ callback ) ) { return new static ( range ( 1 , $ number ) ) ; } return ( new static ( range ( 1 , $ number ) ) ) -> map ( $ callback ) ; } | Create a new collection by invoking the callback a given amount of times . |
21,356 | public function diffUsing ( $ items , callable $ callback ) { return new static ( array_udiff ( $ this -> items , $ this -> getArrayableItems ( $ items ) , $ callback ) ) ; } | Get the items in the collection that are not present in the given items . |
21,357 | public function diffAssocUsing ( $ items , callable $ callback ) { return new static ( array_diff_uassoc ( $ this -> items , $ this -> getArrayableItems ( $ items ) , $ callback ) ) ; } | Get the items in the collection whose keys and values are not present in the given items . |
21,358 | public function diffKeysUsing ( $ items , callable $ callback ) { return new static ( array_diff_ukey ( $ this -> items , $ this -> getArrayableItems ( $ items ) , $ callback ) ) ; } | Get the items in the collection whose keys are not present in the given items . |
21,359 | public function duplicates ( $ callback = null , $ strict = false ) { $ items = $ this -> map ( $ this -> valueRetriever ( $ callback ) ) ; $ uniqueItems = $ items -> unique ( null , $ strict ) ; $ compare = $ this -> duplicateComparator ( $ strict ) ; $ duplicates = new static ; foreach ( $ items as $ key => $ value )... | Retrieve duplicate items from the collection . |
21,360 | protected function duplicateComparator ( $ strict ) { if ( $ strict ) { return function ( $ a , $ b ) { return $ a === $ b ; } ; } return function ( $ a , $ b ) { return $ a == $ b ; } ; } | Get the comparison function to detect duplicates . |
21,361 | public function eachSpread ( callable $ callback ) { return $ this -> each ( function ( $ chunk , $ key ) use ( $ callback ) { $ chunk [ ] = $ key ; return $ callback ( ... $ chunk ) ; } ) ; } | Execute a callback over each nested chunk of items . |
21,362 | public function whereBetween ( $ key , $ values ) { return $ this -> where ( $ key , '>=' , reset ( $ values ) ) -> where ( $ key , '<=' , end ( $ values ) ) ; } | Filter items such that the value of the given key is between the given values . |
21,363 | public function whereNotBetween ( $ key , $ values ) { return $ this -> filter ( function ( $ item ) use ( $ key , $ values ) { return data_get ( $ item , $ key ) < reset ( $ values ) || data_get ( $ item , $ key ) > end ( $ values ) ; } ) ; } | Filter items such that the value of the given key is not between the given values . |
21,364 | public function join ( $ glue , $ finalGlue = '' ) { if ( $ finalGlue === '' ) { return $ this -> implode ( $ glue ) ; } $ count = $ this -> count ( ) ; if ( $ count === 0 ) { return '' ; } if ( $ count === 1 ) { return $ this -> last ( ) ; } $ collection = new static ( $ this -> items ) ; $ finalItem = $ collection ->... | Join all items from the collection using a string . The final items can use a separate glue string . |
21,365 | public function mapSpread ( callable $ callback ) { return $ this -> map ( function ( $ chunk , $ key ) use ( $ callback ) { $ chunk [ ] = $ key ; return $ callback ( ... $ chunk ) ; } ) ; } | Run a map over each nested chunk of items . |
21,366 | public function concat ( $ source ) { $ result = new static ( $ this ) ; foreach ( $ source as $ item ) { $ result -> push ( $ item ) ; } return $ result ; } | Push all of the given items onto the collection . |
21,367 | public function random ( $ number = null ) { if ( is_null ( $ number ) ) { return Arr :: random ( $ this -> items ) ; } return new static ( Arr :: random ( $ this -> items , $ number ) ) ; } | Get one or a specified number of items randomly from the collection . |
21,368 | public function search ( $ value , $ strict = false ) { if ( ! $ this -> useAsCallable ( $ value ) ) { return array_search ( $ value , $ this -> items , $ strict ) ; } foreach ( $ this -> items as $ key => $ item ) { if ( call_user_func ( $ value , $ item , $ key ) ) { return $ key ; } } return false ; } | Search the collection for a given value and return the corresponding key if successful . |
21,369 | public function sortKeys ( $ options = SORT_REGULAR , $ descending = false ) { $ items = $ this -> items ; $ descending ? krsort ( $ items , $ options ) : ksort ( $ items , $ options ) ; return new static ( $ items ) ; } | Sort the collection keys . |
21,370 | public function countBy ( $ callback = null ) { if ( is_null ( $ callback ) ) { $ callback = function ( $ value ) { return $ value ; } ; } return new static ( $ this -> groupBy ( $ callback ) -> map ( function ( $ value ) { return $ value -> count ( ) ; } ) ) ; } | Count the number of items in the collection using a given truth test . |
21,371 | protected function filterEvents ( array $ events ) { if ( ! $ eventName = $ this -> option ( 'event' ) ) { return $ events ; } return collect ( $ events ) -> filter ( function ( $ listeners , $ event ) use ( $ eventName ) { return Str :: contains ( $ event , $ eventName ) ; } ) -> toArray ( ) ; } | Filter the given events using the provided event name filter . |
21,372 | protected function registerOpisSecurityKey ( ) { if ( Str :: startsWith ( $ key = $ this -> app [ 'config' ] -> get ( 'app.key' ) , 'base64:' ) ) { $ key = base64_decode ( substr ( $ key , 7 ) ) ; } SerializableClosure :: setSecretKey ( $ key ) ; } | Configure Opis Closure signing for security . |
21,373 | public function from ( $ address , $ name = null ) { $ this -> swift -> setFrom ( $ address , $ name ) ; return $ this ; } | Add a from address to the message . |
21,374 | public function sender ( $ address , $ name = null ) { $ this -> swift -> setSender ( $ address , $ name ) ; return $ this ; } | Set the sender of the message . |
21,375 | protected function handleBeginTransactionException ( $ e ) { if ( $ this -> causedByLostConnection ( $ e ) ) { $ this -> reconnect ( ) ; $ this -> pdo -> beginTransaction ( ) ; } else { throw $ e ; } } | Handle an exception from a transaction beginning . |
21,376 | public function first ( array $ views , $ data = [ ] , $ mergeData = [ ] ) { $ view = Arr :: first ( $ views , function ( $ view ) { return $ this -> exists ( $ view ) ; } ) ; if ( ! $ view ) { throw new InvalidArgumentException ( 'None of the views in the given array exist.' ) ; } return $ this -> make ( $ view , $ da... | Get the first view that actually exists from the given list . |
21,377 | public function renderWhen ( $ condition , $ view , $ data = [ ] , $ mergeData = [ ] ) { if ( ! $ condition ) { return '' ; } return $ this -> make ( $ view , $ this -> parseData ( $ data ) , $ mergeData ) -> render ( ) ; } | Get the rendered content of the view based on a given condition . |
21,378 | protected function viewInstance ( $ view , $ path , $ data ) { return new View ( $ this , $ this -> getEngineFromPath ( $ path ) , $ view , $ path , $ data ) ; } | Create a new view instance from the given arguments . |
21,379 | public function handle ( ChannelManager $ manager ) { $ manager -> sendNow ( $ this -> notifiables , $ this -> notification , $ this -> channels ) ; } | Send the notifications . |
21,380 | protected function gatherOptions ( ) { return new ListenerOptions ( $ this -> option ( 'env' ) , $ this -> option ( 'delay' ) , $ this -> option ( 'memory' ) , $ this -> option ( 'timeout' ) , $ this -> option ( 'sleep' ) , $ this -> option ( 'tries' ) , $ this -> option ( 'force' ) ) ; } | Get the listener options for the command . |
21,381 | public function assertExists ( $ path ) { $ paths = Arr :: wrap ( $ path ) ; foreach ( $ paths as $ path ) { PHPUnit :: assertTrue ( $ this -> exists ( $ path ) , "Unable to find a file at path [{$path}]." ) ; } return $ this ; } | Assert that the given file exists . |
21,382 | public function assertMissing ( $ path ) { $ paths = Arr :: wrap ( $ path ) ; foreach ( $ paths as $ path ) { PHPUnit :: assertFalse ( $ this -> exists ( $ path ) , "Found unexpected file at path [{$path}]." ) ; } return $ this ; } | Assert that the given file does not exist . |
21,383 | public function response ( $ path , $ name = null , array $ headers = [ ] , $ disposition = 'inline' ) { $ response = new StreamedResponse ; $ disposition = $ response -> headers -> makeDisposition ( $ disposition , $ name ?? basename ( $ path ) ) ; $ response -> headers -> replace ( $ headers + [ 'Content-Type' => $ t... | Create a streamed response for a given file . |
21,384 | public function download ( $ path , $ name = null , array $ headers = [ ] ) { return $ this -> response ( $ path , $ name , $ headers , 'attachment' ) ; } | Create a streamed download response for a given file . |
21,385 | public function getVisibility ( $ path ) { if ( $ this -> driver -> getVisibility ( $ path ) == AdapterInterface :: VISIBILITY_PUBLIC ) { return FilesystemContract :: VISIBILITY_PUBLIC ; } return FilesystemContract :: VISIBILITY_PRIVATE ; } | Get the visibility for the given path . |
21,386 | public function flushCache ( ) { $ adapter = $ this -> driver -> getAdapter ( ) ; if ( $ adapter instanceof CachedAdapter ) { $ adapter -> getCache ( ) -> flush ( ) ; } } | Flush the Flysystem cache . |
21,387 | protected function loadNamespaced ( $ locale , $ group , $ namespace ) { if ( isset ( $ this -> hints [ $ namespace ] ) ) { $ lines = $ this -> loadPath ( $ this -> hints [ $ namespace ] , $ locale , $ group ) ; return $ this -> loadNamespaceOverrides ( $ lines , $ locale , $ group , $ namespace ) ; } return [ ] ; } | Load a namespaced translation group . |
21,388 | protected function pendingMigrations ( $ files , $ ran ) { return Collection :: make ( $ files ) -> reject ( function ( $ file ) use ( $ ran ) { return in_array ( $ this -> getMigrationName ( $ file ) , $ ran ) ; } ) -> values ( ) -> all ( ) ; } | Get the migration files that have not yet run . |
21,389 | protected function getSchemaGrammar ( $ connection ) { if ( is_null ( $ grammar = $ connection -> getSchemaGrammar ( ) ) ) { $ connection -> useDefaultSchemaGrammar ( ) ; $ grammar = $ connection -> getSchemaGrammar ( ) ; } return $ grammar ; } | Get the schema grammar out of a migration connection . |
21,390 | protected function deleteKeysByReference ( $ reference ) { foreach ( explode ( '|' , $ this -> tags -> getNamespace ( ) ) as $ segment ) { $ this -> deleteValues ( $ segment = $ this -> referenceKey ( $ segment , $ reference ) ) ; $ this -> store -> connection ( ) -> del ( $ segment ) ; } } | Find and delete all of the items that were stored against a reference . |
21,391 | public function routes ( array $ attributes = null ) { if ( $ this -> app -> routesAreCached ( ) ) { return ; } $ attributes = $ attributes ? : [ 'middleware' => [ 'web' ] ] ; $ this -> app [ 'router' ] -> group ( $ attributes , function ( $ router ) { $ router -> match ( [ 'get' , 'post' ] , '/broadcasting/auth' , '\\... | Register the routes for handling broadcast authentication and sockets . |
21,392 | public static function matchesType ( $ actual , $ type ) { if ( $ actual === $ type ) { return true ; } $ split = explode ( '/' , $ actual ) ; return isset ( $ split [ 1 ] ) && preg_match ( '#' . preg_quote ( $ split [ 0 ] , '#' ) . '/.+\+' . preg_quote ( $ split [ 1 ] , '#' ) . '#' , $ type ) ; } | Determine if the given content types match . |
21,393 | public function accepts ( $ contentTypes ) { $ accepts = $ this -> getAcceptableContentTypes ( ) ; if ( count ( $ accepts ) === 0 ) { return true ; } $ types = ( array ) $ contentTypes ; foreach ( $ accepts as $ accept ) { if ( $ accept === '*/*' || $ accept === '*' ) { return true ; } foreach ( $ types as $ type ) { i... | Determines whether the current requests accepts a given content type . |
21,394 | public function acceptsAnyContentType ( ) { $ acceptable = $ this -> getAcceptableContentTypes ( ) ; return count ( $ acceptable ) === 0 || ( isset ( $ acceptable [ 0 ] ) && ( $ acceptable [ 0 ] === '*/*' || $ acceptable [ 0 ] === '*' ) ) ; } | Determine if the current request accepts any content type . |
21,395 | public function format ( $ default = 'html' ) { foreach ( $ this -> getAcceptableContentTypes ( ) as $ type ) { if ( $ format = $ this -> getFormat ( $ type ) ) { return $ format ; } } return $ default ; } | Get the data format expected in the response . |
21,396 | public function flushFacades ( ) { if ( ! $ this -> files -> exists ( $ storagePath = storage_path ( 'framework/cache' ) ) ) { return ; } foreach ( $ this -> files -> files ( $ storagePath ) as $ file ) { if ( preg_match ( '/facade-.*\.php$/' , $ file ) ) { $ this -> files -> delete ( $ file ) ; } } } | Flush the real - time facades stored in the cache directory . |
21,397 | protected function cache ( ) { $ cache = $ this -> cache -> store ( $ this -> argument ( 'store' ) ) ; return empty ( $ this -> tags ( ) ) ? $ cache : $ cache -> tags ( $ this -> tags ( ) ) ; } | Get the cache instance for the command . |
21,398 | public function getQueue ( $ queue ) { $ queue = $ queue ? : $ this -> default ; return filter_var ( $ queue , FILTER_VALIDATE_URL ) === false ? rtrim ( $ this -> prefix , '/' ) . '/' . $ queue : $ queue ; } | Get the queue or return the default . |
21,399 | protected function secondsUntil ( $ delay ) { $ delay = $ this -> parseDateInterval ( $ delay ) ; return $ delay instanceof DateTimeInterface ? max ( 0 , $ delay -> getTimestamp ( ) - $ this -> currentTime ( ) ) : ( int ) $ delay ; } | Get the number of seconds until the given DateTime . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.