December 2016
Beginner
189 pages
3h 5m
English
© Sanjib Sinha 2017
Sanjib Sinha, Beginning Laravel, 10.1007/978-1-4842-2538-7_5
Sanjib Sinha1
(1)Howrah, West Bengal, India
In MVC framework controller has a definite role. It primarily controls the flow between model and view. In ‘routes.php’ file we’ve seen how we send the request using HTTP protocol. Now we want to organize the same behavior using controller class.
Let us remember the first route method. When you install Laravel it normally comes with this default route method .
Route::get('/', function () {return view('welcome');});
In this route method we get a view. As the route method says: return a view. The question is: where are models and controllers? We are not supposed to create only views using a Closure, are we? ...
Read now
Unlock full access