Showing 10 of 1,204 results.

Laravel String Helper Function: substr

…is a convenient helper built on top of PHP's mb_substr function (unlike PHP's mb_substr function, substr does not provide a way to change the encoding that is used) that is used to return a portion of a string. The substr method defines two...

Soft Deleted Comments

…soft delete" a comment; this means that the comment will still exist. By default, Meerkat will not include these comments when using the {{ meerkat:responses }} tag.To display soft deleted comments, we can supply a value of true for the...

Laravel Collection Public API: reject

reject($callback) The reject method used to create a new Collection instance containing all the items in the collection that do not pass a given truth test. The reject method only defines one parameter: $callback . The $callback function should...

Laravel 5: Creating Eloquent Models for Testing With factory

…// Return an instance of the 'User' model. 2 $ user = factory ( ' App\User ' ) -> make ( ) ; 3 4 // Return two instances of the 'User' model. 5 $ users = factory ( ' App\User ' , 2 ) -> make ( ) ; 6 7 // Return one instance of the 'User' model,...

Laravel Artisan Event Command: The event:generate Command

…or the application. 12 * 13 * @var array 14 */ 15 protected $ listen = [ 16 ' App\Events\BookWasPurchased ' => [ 17 ' App\Listeners\EmailPurchaseConfirmation ' , 18 ] , 19 ] ; 20 21 /** 22 * Register any other events for your application. 23 * 24...

Laravel MessageBag Public API: toJson

…will return a JSON encoded version of the data stored within the message bag instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied. Like the json_encode function, the...

Filter Search