Laravel 8 from scratch Flashcards
how do you start a laravel server with artisan
php artisan serve
what function do we use to render a 404 page?
abort();
how to cache in a route?
cache()->remember(unique name , seconds (now()->addHour()) , closure)
what do we return if we cannot find a model?
new modelNotFoundException();
what PHP function do we use to return an array from another array?
array_map();
what wrapper do we use in laravel for PHP arrays?
a collection
how do we echo something in blade?
{{ }}
how to echo un-escaped HTML in blade?
{!! !!}
how to write a foreach in blade?
@foreach @endforeach
how to dd in blade template?
@dd();
how to add conditional to blade template?
@if @endif
how to add opposite conditional to blade?
@unless @endunless
how to migrate in PHP artisan?
php artisan migrate
how to rollback in php artisan?
php artisan migrate:rollback
how to restart all migrations in php artisan?
php artisan migrate:refresh