Showing 7 of 1,975 result(s)
…xception using only the user supplied $message . The following example assumes that some $user object exists with the property admin . The example will check to make sure that the admin property is true . If not, the code will abort with a 401...
In order to supply extra headers we must also provide an argument for $status and then supply an argument for $headers : The following image shows the results of a request that contains the request headers. You can see that the Laravel header is...
encrypt($value) The encrypt helper function can be used to encrypt a given $value . The function resolves the configured Illuminate\Contracts\Encryption\Encrypter implementation from the Service Container and then calls the encrypt method on the...
session($key = null, $default = null) The session function is a versatile function. It can be used to return the \Illuminate\Session \SessionManager instance, to set session values and to retrieve session values.
When a MessageBag instance is cast into a string, its JSON representation is returned as the result. Internally this is accomplished by returning the result of the toJson method. After the above code executes, the $stringValue variable would...
The getBags method is used to return an associative array containing all the MessageBag instances that are currently stored within the ViewErrorBag instance. After the above code has executed, the $messageBags variable would be an array and...
The Translator class exposes the addNamespace method as part of its public API. The addNamespace internally makes a call to the addNamespace method on the current instance of the Illuminate\Translation\LoaderInterface implementation, which by...