Layouts
In resources/views you can create your templates
- Named the file as: layout.blade.php
- @yield('<section>') will be the section that will be replaced later by your view
Implement
- @extends('<template>')
- To specify the template to use
- @section('<section_name>')
- To indication which section will be replaced
- @stop
- To indicate the end of the section
Example:
<!DOCTYPE html>
<html>
<head>
<title>Notes</title>
<meta charset="UTF-8">
@yield('header')
</head>
<body>
@yield('content')
@yield('footer')
</body>
</html>
Routes
Add in the file app\Http\routes.php your route
Route::get('<path>/{<paramenter>}', '<Controller>@<method>');
Ej. Route::get('cards/{idd}', 'CardController@show');
Form
Add the following line in each form where you are using POST
< meta name="csrf-token" content="{{ csrf_token() }}" />
Redirect
return redirect()->to('<path>');
return redirect('<path>');
Send to the previous Page
redirect back();
Comentarios
Publicar un comentario