Laravel Framework Reference Guide
Quick reference guide for the Laravel framework — query builder, Eloquent, controllers, and more.
These notes are written for anyone who's used Laravel before and needs a fast reminder of syntax, rather than a first introduction to the framework. Each topic below is a self-contained page with runnable code examples, organized by category so related concepts sit together. They lean on the official Laravel documentation for anything that needs the full detail, but cover enough on their own that you shouldn't need to leave the page for common tasks.
Why Laravel
Laravel is a PHP framework built around convention over configuration: routing, the ORM, validation, queues, caching, and authentication are all provided out of the box and designed to work together, so a new project gets a consistent structure without much upfront decision-making. That's the main appeal over assembling a stack from individual PHP libraries — less boilerplate and fewer integration decisions, at the cost of some flexibility if a project's needs fall outside what the framework expects.
Eloquent, Laravel's ActiveRecord-style ORM, is usually the biggest single reason developers pick it over a plain PHP or a leaner framework like Slim. Relationships, eager loading, query scopes, and model events cover most of what an application needs from its database layer without writing raw SQL, and the same fluency carries through to migrations, form validation, and the templating engine (Blade). The trade-off is a heavier framework with more moving parts than a minimal router-plus-database-layer setup, which matters for very small scripts but pays off quickly once an application grows past a handful of routes.
Starting a new project
composer create-project laravel/laravel PROJECTNAME
cd PROJECTNAME
Authentication scaffolding — pick one
Laravel Breeze — lightweight, modern, easiest to customize. Blade views only (no Vue/React), so the Node build tooling can be stripped out afterwards.
composer require laravel/breeze --dev
php artisan breeze:install blade
rm -rf node_modules package.json package-lock.json vite.config.js
php artisan migrate
Laravel UI + Bootstrap — older-style scaffolding, matches this project's own login/register modals.
composer require laravel/ui
php artisan ui bootstrap --auth
Further viewing
Fundamentals
The pieces every Laravel request passes through: a route matches the URL, middleware filters or inspects the request, a controller handles the logic, and Blade renders the response.
Data
Reading and writing data, from Eloquent's ORM down to raw query building and the migration syntax that defines a table's columns in the first place.
Validation & Security
Rejecting bad input before it reaches application logic, and controlling what an authenticated user is allowed to do once they're in.
Automation & Communication
Work that happens outside the request/response cycle: scheduled jobs, custom Artisan commands, and outbound email or notifications.