Prevent using Back button to see Sensitive Content
A security issue that can occur if pages aren't re-validated is that if someone was to use the Back button on the browser, they will be able to see potentially
A security issue that can occur if pages aren't re-validated is that if someone was to use the Back button on the browser, they will be able to see potentially
In order to copy text that matches part of a regular expression you have to mark the part that you want to be able to copy. You do this with
Sometimes I want to disable the submit button on click so that someone with slow internet doesn't submit a form multiple times. The fastest way to do it is this
This command will get all column names in one table SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='insertdatabasename' AND `TABLE_NAME`='inserttablename'; This will get columns from
Event::fire('foo.bar', array($bar)); Event::listen('foo.bar', function($bar){}); Event::listen('foo.*', function($bar){}); Event::listen('foo.bar', 'FooHandler', 10); Event::listen('foo.bar', 'BarHandler', 5)
Introduction cURL allows transfer of data across a wide variety of protocols, and is a very powerful system. It's widely used as a way to send data across websites, including
Auto-Magic Pagination Model::paginate(15); Model::where('cars', 2)->paginate(15); "Next" and "Previous" only Model::where('cars', 2)->simplePaginate(15); Manual Paginator Paginator::make($items,
Model::create(array('key' => 'value')); Find first matching record by attributes or create Model::firstOrCreate(array('key' => 'value')); Find first record by attributes or instantiate Model::firstOrNew(array(
Laravel Database Eloquent DB::connection('connection_name'); DB::statement('drop table users'); DB::listen(function($sql, $bindings, $time){ code_here; }); DB::transaction(function(){ transaction_code_here; }); Cache a query for
URL::full(); URL::current(); URL::previous(); URL::to('foo/bar', $parameters, $secure); URL::action('FooController@method', $parameters, $absolute); URL::route('foo', $parameters, $absolute); URL::secure('foo/bar', $parameters); URL::asset(
Log::info('info'); Log::info('info',array('context'=>'additional info')); Log::error('error'); Log::warning('warning'); Get monolog instance Log::getMonolog(); Add listener Log::listen(function($level, $message, $context)
App::environment(); Test equal to App::environment('local'); App::runningInConsole(); App::runningUnitTests();
Route::get('foo', function(){}); Route::get('foo', 'ControllerName@function'); Route::controller('foo', 'FooController'); RESTful Controllers Route::resource('posts','PostsController'); //Specify a subset of actions to handle on the route Route:
You may access configuration values using the Global config helper function from anywhere in the application. $value = config('app.timezone'); To set the config values at runtime, pass an array
You can use Composer to create new projects from an existing package. composer create-project laravel/laravel folder_name The install command reads the composer.json file from the current directory,