Showing 10 of 2,044 results.

Laravel String Helper Function: randomBytes

The randomBytes helper method is used to generate a string of bytes of the given $length . The results of the randomBytes are more random than the results of the random method. randomBytes requires the OpenSSL extension extension for PHP version 5...

Default Laravel Classes That Support Macros

The following Laravel classes allow for macros to be created by using the \Illuminate\Support\Traits\Macroable trait. There are, at the time of this writing, six classes that ship with direct support for macros: Class Description...

Laravel 5: Conditionally Throwing HTTP Exceptions With abort_if

…4 $ message = ' ' , 5 array $ headers = [ ] 6 ) ;The following example assumes that some $user object exists with the property admin . The example will check to make sure that the admin property is true . If not, the code will abort with a 401...

Laravel 5 Macros: Injecting Class-Based Macros With mixin

The mixin static method is used to load the methods of a mixin class instance into the target class as macro methods. The mixin method accepts a class instance as its first and only argument.The signature of the mixin method is: 1 public static...

Ordering by Multiple Properties | Sorting Comment Threads

Multiple sort orders can be applied to a single comment thread by chaining sort orders with the pipe ( | ) character. The following example demonstrates how to first sort by newest comments, and then by the contents of the comment: 1 {{ meerkat :...

14. Revised Versions of this License. | License

…you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you...

Example Use | Laravel 5: Adding Elements to the Array with add

Consider the following code snippet: 1 use Illuminate \ Support \ Arr ; 2 3 $ myArray = [ 4 ' animal ' => ' Araripe Manakin ' , 5 ' plant ' => ' Pineland Wild Petunia ' 6 ] ; 7 8 $ myArray = Arr :: add ( 9 $ myArray , 10 ' insect ' , 11 '...