Showing 10 of 2,044 results.

Laravel 5: Throwing HTTP Exceptions With abort

…$ message = ' ' , 4 array $ headers = [ ] ` 5 );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...

Laravel Helper Function: encrypt

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

Laravel Array Helper Function: array_except

The except helper method will return all the key/value pairs of the $array where the keys in the original array are not in the $keys array. The signature for the except helper method is: except($array, $keys) Assuming that the $_POST super-global...

toJson($options = 0) | Laravel Fluent Part Two: The Public API

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

Building the Front-end

…oduction use-cases. If you haven't already, you will need to install Tidal's front-end dependencies by running the following command from the root of your project: 1 npm installTo have Vite watch for changes made to your site's content and assets...

getPhpBlocks | Querying Document Nodes

…deCollection ; 4 5 public function getPhpBlocks ( ) : NodeCollection ; Example Use 1 <?php 2 3 use Stillat \ BladeParser \ Document \ Document ; 4 5 $ template = <<< ' BLADE ' 6 @php 7 $ count = 1 ; 8 @endphp 9 10 @php ( $ count ++ ) 11 12 @php...

getDirectives | Querying Document Nodes

Returns all directives within the document. Returns all directives from the source document. Some directive pairs, such as the @php / @endphp and @verbatim / @endverbatim pairs will not result in an instance of DirectiveNode , as they are handled...

Setting a Session Value | Laravel Helper Function: session

The session function allows setting session values directly by passing in an array of key/value pairs. The following example demonstrates this: 1 <?php 2 3 // Settings two session values 'test' and 'test'2 4 session ( [ 5 ' test ' => ' A test...

Laravel Artisan Tinker: The migrate Command

The migrate command is used to run migrations against the database. It provides many different options and flags (six in total). The following table lists and explains each of these options and flags. Option/Flag Description Default Value...

General Metadata

The general metadata builder provides various methods to add common metadata information to your site, such as keywords, titles, and descriptions. To access the general metadata builder using the Metadata facade, we can call the general method: 1...