Controllers and Actions
Create controllers with artisan and handle requests in action methods.
What is a Controller?
A controller groups related request-handling logic. Instead of closures in route files, you delegate to controller methods (actions).
Generating a Controller
Use Artisan to scaffold a controller.
$ php artisan make:controller UserController
$ php artisan make:controller PostController --resourceAll lessons in this course
- Laravel Project Structure
- Defining Routes in Laravel
- Controllers and Actions
- Blade Templates and Views