Showing 7 of 587 result(s)
The $options parameter allows developers to change the sorting behavior of the sortBy method. The accepted options are the same options that are defined for PHP's sort function. The following collection instance will be used throughout this...
The following tables will show how the different sorting flags change the sorting of the previously made $collection . Each sorting flag has its own section, which will follow this section. The first table shows the key and its associated value...
The make static method creates a new instance of a collection with the provided $items (assuming that the provided $items argument is not already a collection instance).The following code sample highlights the usage of the make static method:
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...
To override the 500 Server Error page, we can simply create a new 500.html file within the errors directory. The contents of this file can be anything, but remember that you are not guaranteed to have access to any server-side languages, such as...
It is often that when working on projects locally, the project is in debug mode. Because of this, we will see screens like this instead of our custom error page: To have our custom error page show up we need to temporarily update our .env file and...
When building our site's template using Antlers, we usually add our site's CSS or JavaScript assets using the {{ mix }} Antlers tag. Because we are assuming that all server-side languages are not an option, we can simply reference our public...