Search

Showing 7 of 1,975 result(s)

/blog/2016/11/19/laravel-array-helper-function-array_first

first($array, callable $callback = null, $default = null) Let's begin discussing the first helper method be examining the $callback . The $callback is a function that accepts a $key and a $value as its parameters. The following code sample is an...

/blog/2016/12/01/the-laravel-framework-console-kernel#content-callcommand-array-parameters--

The call method is used to execute an Artisan command from somewhere else in your applications code. It accepts the name of the command via an argument supplied for the $command parameter and an array of $parameters that should be supplied to the...

/blog/2016/12/07/laravel-artisan-custom-styles-custom-progress-bar-styles#content-using-icons-in-progress-bar-text

To add a little extra touch to your progress bars (or console output in general), we can add embed Unicode symbols and pictographs into our console output. This is done by using double quotes and supplying the UTF-8 hex encoding of the character...

/blog/2017/07/23/the-statamic-addon-roundup#content-categoriesfilter

The CategoriesFilter add-on is simply a custom Statamic Collection Filter that is really good at figuring out how articles on the site are related to one another based on their category. This is made simpler by the fact that I am limiting each...

/blog/2018/04/22/laravel-5-collections-reducing-a-collection-with-user-defined-keys-with-mapwithkeys

The mapWithKeys is similar to the mapToDictionary and mapToGroups methods in that it accepts a $callback function that defines an association between the returned key and value. The mapWithKeys method does not change the original collection; it...

/blog/2018/04/22/laravel-5-collections-sorting-a-collection-with-sort

The sort method is used to sort the collection. If no $callback is provided, the collection will be sorted using a case-insensitive "natural order" algorithm. An optional $callback can be supplied to customize the comparison that is used when...

/blog/2018/04/22/laravel-5-collections-static-api-returning-the-items-of-a-collection-with-unwrap

The unwrap method is the logical opposite of the wrap method, in that if the provided value is already a collection, the collection's underlying items will be returned. If the provided value is not a collection instance, the value is simply...