Showing 10 of 2,055 results.

Laravel String Helper Functions

…dified copy of the string will be returned from the function (unless stated otherwise). 1 use Illuminate \ Support \ Str ; 2 3 $ firstString = ' my words ' ; 4 5 // Returns `MyWords` 6 Str :: studly ( $ firstString ) ; 7 8 // Displays 'my words'...

Laravel 5 Macros: Public API

The following sections discuss the various methods that become available when utilizing the Macroable trait; there are not that many of them, but that does not detract from the fact that the Macroable trait is incredibly useful.The following...

Laravel Application Helper: database_path

…unction can be used to retrieve the path to the database directory. It can also be used to construct paths relative to the database directory by supplying a $path . The following examples will assume that the Laravel application is installed in...

Laravel String Helper Function: str_replace_first

The replaceFirst helper method is used to replace the first occurrence of a given $search string with the provided $replace string in the $subject string. All three parameters are required and must be strings. The signature for the replaceFirst...

Defining Custom Filters | Advanced Filtering

Custom filters can also be defined in the meerkat/filters.php file using the filter helper method. The following filter will only return comments that contain the phrase hello in their content: 1 <?php 2 3 use Illuminate \ Support \ Str ; 4 use...