0PricingLogin
PHP Academy · Lesson

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 --resource

All lessons in this course

  1. Laravel Project Structure
  2. Defining Routes in Laravel
  3. Controllers and Actions
  4. Blade Templates and Views
← Back to PHP Academy