3. Laravel_Controllers
3. Laravel_Controllers
1. Controller
Controller
• Instead of defining all of your request handling logic as
Closures in route files, you may wish to organize this behavior
using Controller classes.
• Locate in app\Controllers
Creating a new controller
Php artisan make:controller XXXController
For example:
Route::resource(‘url’, ‘ControllerName’);
• url: Url to display to screen, such as ‘test’. It will generate 7 basic methods (test/,
test/create…) as mentioned above