Framework cheatsheet
Laravel 13 Cheatsheet
Everyday Artisan commands for Laravel 13 projects.
Getting started
- Check the Laravel version — Run from the root of your Laravel project to see the installed framework version.
- List Artisan commands — List available commands, including commands provided by installed packages.
- Start the development server — Start Laravel's local development server from the project directory.
- Open an interactive shell — Open Tinker to interact with the application and its models.
Controllers and routes
- Create a controller — Generate a controller in app/Http/Controllers.
- Create a resource controller — Generate a controller with the conventional CRUD methods.
- Create an API resource controller — Generate CRUD methods for an API without HTML form actions.
- List registered routes — Inspect methods, paths, names and actions registered by the application.
- Create middleware — Generate middleware to inspect or filter incoming requests.
- Create a form request — Generate a form request class for validation and authorization.
Models and database
- Create a model and migration — Generate a model and its migration together.
- Create a migration — Generate a migration file for a new posts table, then define its columns in the generated file.
- Run migrations — Apply outstanding migrations to the configured database.
- Check migration status — Show which migrations have run and which are pending.
- Roll back the last migration batch — Run the down method for the most recent batch of migrations.
- Rebuild a development database — Drop all tables and run every migration again.
- Create a factory — Generate a model factory for development and test data.
- Create and run a seeder — Create a seeder, add its data in run(), then execute that seeder.
Testing and cache
- Create a feature test — Generate a feature test in the tests directory.
- Run tests — Run the project's automated test suite.
- Clear optimized caches — Clear cached bootstrap files produced by Laravel's optimization commands.
- Cache configuration for deployment — Combine configuration files into a cached file for production.
Queues
- Create a queued job — Generate a job class for work that can be processed in the background.
- Run a queue worker — Start a worker that processes jobs from the configured queue connection.
- Restart queue workers after deployment — Ask workers to exit gracefully after their current job so a process monitor can start workers with the new code.
Related cheatsheets
- Angular 22 cheatsheet — Angular CLI commands and standalone component, signals, template, routing, HTTP and forms snippets.
- Astro cheatsheet — Build fast content sites with Astro: components, layouts, routing, content collections, islands, endpoints and deployment.
- Django 6 cheatsheet — Create projects, run migrations, test and deploy Django apps, plus the ORM queries you use every day.
- .NET and ASP.NET Core 10 cheatsheet — The dotnet CLI for creating, building, testing and publishing projects, plus common ASP.NET Core and EF Core code.
- Express 5 cheatsheet — Build HTTP servers and APIs with Express 5 on Node.js.
- FastAPI 0.115 cheatsheet — Install, run, test and deploy FastAPI apps from the command line.