Showing 10 of 1,280 results.

Laravel Artisan General Command: The env Command

The env command is used to simply return the name of the current framework environment. The environment name that is returned is set in the .env file (specifically whatever value is set for the APP_ENV entry). 1 # Display the current framework...

Laravel Application Helper: old

old($key = null, $default = null) The old helper function is used to retrieve an old input item. It is a shortcut to calling the Illuminate\Http\Request::old instance method. It accepts a $key argument and a $default argument. They $key should be...

Laravel 5: Generating CSRF Hidden HTML Fields With csrf_field

The csrf_field function can be used to generate a hidden HTML element containing the value of the CSRF token. These tokens can help to prevent cross-site request forgeries.The signature of the csrf_field function is: 1 function csrf_field ( ) ;For...

Laravel Security Helper Function: e for HTML Entities

The e function is a simple wrapper of PHP's htmlentities function. The e function utilizes the UTF-8 character encoding. The e function will sanitize user input when displaying it to the browser. The signature for the e helper function is:...

Laravel 5: Hashing Strings With bcrypt

The bcrypt function will return a hashed representation of the given $value . The bcrypt function also accepts an array of $options which can be used to affect how the hash is computed. Each invocation of the bcrypt function should produce a...

Laravel 5: Ensuring a Value is an Array With wrap

At some point in your PHP adventures, you have either seen, or written code like the following: 1 function checkDomains ( $ domains ) { 2 if ( ! is_array ( $ domains ) ) { 3 $ domains = ( array ) $ domains ; 4 } 5 6 foreach ( $ domains as $ domain...