Showing 10 of 2,145 results.

Laravel Miscellaneous Helper Function: value

value($value) The value function will return the default value of the supplied $value . Although this sounds redundant, if the supplied $value is an instance of the Closure class, the function will be executed and the value will be returned. If...

Laravel Collection Public API: intersect

intersect($items) The intersect removes any values that are not in the provided $items array. The intersect method returns a new instance of Collection . The intersect method preserves any keys from the original collection. The following code...

The where Filter | The "where" Filters

The where filter accepts a comment property, a comparison operator, and a check value as its arguments. You may refer to the comment properties documentation to see what is available when using this filter (custom addon values are also supported)....

Integrating Laravel Spark, Stripe, and Statamic 3

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...

Notes on Decimals | Laravel String Pluralization

In the previous example, trying to match the number 3.4 will throw an instance of InvalidArgumentException . To match any possible number, including decimals, for the previous translation messages, the explicit number groups must be replaced with...

Laravel Artisan Command Input and Command Signatures

Most useful commands need to accept some sort of input from the user. The input can be as simple as requiring users to supply information in the form of parameters and options or can be more complicated by interactively entering data at the...

Laravel ViewErrorBag Public API: put

put($key, Illuminate\Contracts\Support\MessageBag $bag) The put method is used to add a new MessageBag implementation instance to the ViewErrorBag instance, supplied as the argument to the $bag parameter with some name determined by the $key...

Laravel Array Helper Function: array_has

has($array, $key) The has helper method will return a boolean value that indicates if the given $key exists in the supplied $array , using dot notation. This method is incredibly useful when checking if an array has a specific key at an arbitrary...