Tutorial by Examples

<?php namespace App\Http\Controllers; use App\User; use App\Http\Controllers\Controller; class UserController extends Controller { /** * Show the profile for the given user. * * @param int $id * @return Response */ public function show($id) ...
Middleware may be assigned to the controller's routes in your route files: Route::get('profile', 'UserController@show')->middleware('auth'); However, it is more convenient to specify middleware within your controller's constructor. Using the middleware method from your controller's constructor,...
Laravel resource routing assigns the typical "CRUD" routes to a controller with a single line of code. For example, you may wish to create a controller that handles all HTTP requests for "photos" stored by your application. Using the make:controller Artisan command, we can quickl...

Page 1 of 1