Signature | Laravel 5 Collections: Sorting a Collection Based on a Key Value With sortBy
1 public function sortBy ( 2 $ callback , 3 $ options = SORT_REGULAR , 4 $ descending = false 5 ) ;
Showing 10 of 2,145 results.
1 public function sortBy ( 2 $ callback , 3 $ options = SORT_REGULAR , 4 $ descending = false 5 ) ;
info($message, $context = []) The info helper will write an information entry into Laravel's log files. It allows a $message to be set, as well as an optional $context (which is an array of data). While the $context must be an array, the actual...
decrypt($value) The decrypt helper function can be used to decrypt a given $value . The function resolves the configured Illuminate\Contracts\Encryption\Encrypter implementation from the Service Container and then calls the decrypt method on the...
prepend($array, $value, $key = null) The prepend helper method is used to push a new $value onto the beginning of an existing $array . It defines one optional parameter: $key . If an argument is supplied for $key , the new item will be given that...
If you do want to generate the full URL to a controller action, simply supply a truth value of false for the $absolute parameter. The following example demonstrates this: 1 action ( 2 ' ExampleController@sayHello ' , 3 [ ' name ' => ' Jim ' ] , 4...
The user:from_auth filter allows you to filter comments based on if they were left by an authenticated user. It accepts a boolean value, or the wildcard * value (to return comments regardless of if they were left by an authenticated user). The...
The setSelector method sets a Symfony\Component\Translation\MessageSelector instance ( $selector ) for the Translator . The MessageSelector instance is used by the choice and transChoice methods for loading the correct translation message based on...
The needsRehash method is used to determine if the provided $hashedValue has been hashed with the supplied $options . This is useful for when the work factor of a hashing function has been updated and all passwords need to be updated to use the...
This guide contains the steps to configure Statamic and Meerkat to only accept comments from authenticated users. After completing this guide, your site will only accept comments from authenticated users, without requiring user names or emails to...
reverse The reverse method is used to reverse the order of items in a collection. The reverse method returns a new Collection instance. The reverse method does not preserve numerical keys but will preserve non-numerical keys. The following code...