Showing 7 of 1,975 result(s)
The partition method can also be used with higher order messaging, which allows us to invoke collection methods and access object instance properties using PHP's property accessors syntax. In the reject section, we created a Product class that was...
The keys method is used to retrieve the keys of all items in the collection. The keys method returns a new Collection instance. The behavior of the keys method is similar to PHP's array_keys function.public function keys();The following code...
In the following example, we will use the sortBy with higher order messages, which allows us to invoke certain collection methods using PHP's property accessors syntax. To start, we will create a new PeripheralDevice class which will simply hold...
Throughout this article we will create a fairly basic integration between Statamic 3 and the newly updated Laravel Spark . This guide will be using Spark's Stripe option, but if you want to use Paddle, the overall steps should not be too...
In this blog post, we'll cover a simple method to implement a honeypot form mechanism. A honeypot is a simple security measure designed to catch bots and automated scripts using an inconspicuous form field that human users should leave empty. We...
…e do not enclose the input value in quotes we would receive an error stating something similar to "Too many arguments" or we would accidentally supply an incorrect value for a different input parameter. php artisan make:model "My Directory/User"...
The toBase method will return a new collection instance containing all of the data in the current collection instance. This can be useful for method chaining when you need to modify the collection's contents without changing the original...