Showing 7 of 1,975 result(s)
keys The keys method is used to retrieve the keys of all items in the collection. The keys method returns a new Collection instance. The following code example demonstrates the usage of the keys method: After the above code executes, the $keys...
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 registerCommand method is used to register a command with the console application. In older versions of Laravel, it was required to use this method to register any custom commands with the console kernel. The registerCommand method expects a...
The make:auth command can be used to generate login and registration views, a basic HomeController controller and routes that can be used for basic authentication tasks. It accepts the optional flag --views which can be used to only generate the...
In the following example, we will extend the MessageSelector to return always return the same string when resolving a translation line using the choice and transChoice methods: Armed with our custom MessageSelector implementation, we can now set...
The prepend helper method is used to push a new $value onto the beginning of an existing $array . It defines one optional parameter: $key . If an argument is supplied for $key , the new item will be given that key. Supply a value for $key if you...
The following two code examples are equivalent: