Catalog / Laravel Cheat Sheet
Laravel Cheat Sheet
A quick reference guide for Laravel developers, covering essential commands, concepts, and configurations.
Basic Commands & Concepts
Artisan Commands
|
Display the Laravel version. |
|
Create a new controller. |
|
Create a new Eloquent model. |
|
Create a new migration file. |
|
Run pending migrations. |
|
Rollback the last migration. |
|
Start the built-in PHP development server. |
|
Enter the interactive Tinker shell. |
|
Display all registered routes. |
Directory Structure
|
Routing and Controllers
Basic Routing
|
|
Route Parameters
|
Required parameter. |
|
Optional parameter. |
Controllers
|
|
Eloquent ORM
Basic Model Operations
|
Get all records. |
|
Find a record by primary key. |
|
Create a new record. |
|
Update an existing record. |
|
Delete a record. |
Relationships
|
|
|
Blade Templating
Basic Syntax
|
Display a variable (automatically escaped). |
|
Display a variable without escaping. |
|
Conditional statement. |
|
Looping. |
Components and Layouts
|
Directives
|
Check if the user is authenticated. |
|
Check if the user is a guest. |
|
Generate a CSRF token field. |