created_at
if $timestamps=true
$incidents = Incident::where('monitor_id','=',1)->latest()->get();
$incidents = $monitor->incidents()->orderBy('started_at','desc')->take(3)->get();
$incidents = Incident::where('monitor_id','=',1)->take(10)->get();
return redirect()->action('SomeController@method', ['param' => $value]);
$users = User::where('name', 'Mary')->get()->dd();
To check whether an use is authenticated or not, use the @auth
directive:
@auth
<h1> You are now authenticated! </h1>
@endauth
Filter out records that have n amount of children records:
$authors = Author::has('books', '>', 5)->get();
$items = Item::whereMonth('created_at', '12')->get();
$items = Item::whereDay('created_at', '31')->get();
$items = Item::whereYear('created_at', '2017')->get();
$items = Item::whereDate('created_at', '2017-01-31')->get();
$items = Item::whereTime('created_at', '12:34:56')->get();
php artisan make:migration --path="app/some_folder/some_migrations_folder" name_of_migration
php artisan migrate --path="app/some_folder/some_migrations_folder"