Showing 10 of 1,280 results.

Laravel 5 Collections: Paginating Collections With forPage

The forPage method is used to implement pagination over collections. The forPage defines two parameters: $page , which is used to tell the collection which "page" should be returned and $perPage , which is used to control the number of items that...

Laravel Artisan Tinker: The buffer Command

The buffer command is useful when entering multi-line expressions. It can be used at any time to view the contents of the buffer when entering multi-line expressions without interrupting the expression input. The following example sessions...

Laravel String Helper Function: lower

The lower helper method takes a given value and returns a lower cased variant. The signature for the lower helper function is: lower($value) 1 use Illuminate \ Support \ Str ; 2 3 // all lower cased 4 echo Str :: lower ( ' ALL LOWER CASED ' ) ;

Laravel Collection Public API: flatten

flatten The flatten method will return a new Collection instance representing a flattened version of the original collection's items. The flatten method internally makes use of the Illuminate\Support\Arr::flatten($array) helper method. The flatten...

Laravel 5: Getting Array or Object Values With data_get

The data_get function is identical in behavior to both the array_get and object_get function. The difference is that the data_get function will accept both objects and arrays as its $target input value.The signature of the data_get function is: 1...

Laravel Application Helper: app

app($make = null, $parameters = []) The app function provides access to the Illuminate\Container\Container instance. Because Container is a singleton, any call to app() will return the same Container instance. The app function can also be used to...

Laravel Collection Public API: intersect

intersect($items) The intersect removes any values that are not in the provided $items array. The intersect method returns a new instance of Collection . The intersect method preserves any keys from the original collection. The following code...

Laravel Artisan Generator Command: The make:migration Command

The make:migration command is used to generate a new migration class. Generated migrations are (by default) stored in the database/migrations directory. The make:migration defines a few parameters and options that can be used to customize the...