jcadima
8/20/2017 - 5:31 PM

Laravel Route paths for blade

Laravel Route paths for blade


Go back link:
{{ redirect()->getUrlGenerator()->previous() }}


CSS asset path in public directory:
{{ asset('css/toastr.min.css') }}



Route with name alias declared in web.php:
{{ route('project.show') }}


Pass an id to a route with parameter:
{{ route('task.completed', ['id' => $task->id]) }}



CSRF protection for forms (required)
{{ csrf_field() }}  using blade templates
using HTML:
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">