Showing 10 of 1,280 results.

Laravel Collection Public API: toJson

toJson($options = 0) The toJson method will return a JSON encoded version of the data stored within the collection instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied....

Laravel String Helper Function: str_replace_last

The replaceLast helper method is the logical opposite of the replaceFirst helper method. It is used to replace the last occurrence of a given $search string with the provided $replace string in the $subject string. ALl three parameters are...

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 Artisan General Command: The up Command

The up command is used to take an application out of maintenance mode. It does this by removing a file named down from the application's framework storage directory (by default this is storage/framework/ ). The following demonstrates the usage of...

Laravel Router Helper Function: post

post($uri, $action) The post function is a shortcut to registering a route with the router that responds to the POST HTTP verb. The $uri is the URI of the route, such as / or login . The $action is what will be executed by the router when the...

Laravel Artisan Config Command: The config:clear Command

The config:clear command is used to remove the configuration cache file created by the config:cache command. By default this command will delete the bootstrap/cache/config.php file. The following example shows how to call the config:clear command:...