Laravel: Non-web routes

In the routes folder you have web.php, but not just that file. We have api.php, channels.php and console.php.

  • web.php handles HTTP requests from web browsers

  • api.php handles API endpoints. We use it to create an API that can be used for example by a mobile application, or directly by the users (if that’s something you want them to)

  • console.php contains routes used by the command line interface, Artisan. We can write command line applications for our app, in PHP, and execute them, it’s pretty handy

Lessons in this unit:

0: Introduction
1: Getting started
2: Blade
3: Dynamic routes
4: Adding a database
5: How to use migrations to create and modify the database schema
6: Using forms to accept user input and store it into the database
7: Adding a better layout
8: Adding the form at the bottom of the list
9: Allow users to delete dogs from the list
10: Adding authentication using Laravel Breeze
11: Only authenticated users can add items to the database
12: Push the app code to GitHub
13: Deployment
14: Dynamic routes advanced
15: ▶︎ Non-web routes
16: Creating commands

Join my AI Workshop!

The Web Development BOOTCAMP cohort starts in February 2026