Skip to content
Tutorials Center
My learning

Topics

Laravel Tutorial

Learn Laravel 13 from installation to routing, Blade, Eloquent, authentication, queues, testing, APIs, performance, deployment and real projects. 67 lessons with examples, quizzes and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Laravel? Learn what Laravel is, what a framework does for you, how Laravel 13 and PHP 8.4 fit together, and what its ecosystem (Herd, Forge, Livewire, Pest) offers.
  2. 2 Installing Laravel and Creating a Project Install Laravel 13 with Herd, the laravel installer or Composer, answer the starter kit prompts, run the app, and understand what happens on the first run.
  3. 3 The Project Structure A guided tour of a Laravel 13 project: app, bootstrap, config, database, public, resources, routes, storage, tests and the slim bootstrap/app.php file.
  4. 4 The Request Lifecycle Follow a request through Laravel 13: index.php, bootstrap, providers, middleware, router and response, with a runnable mini front controller.
  5. 5 Configuration and Environments Learn how Laravel 13 reads .env files and config/ arrays, why env() belongs only in config files, what config:cache does, and what APP_KEY protects.
  6. 6 Artisan and Custom Commands Learn Laravel Artisan: list and help, make generators, tinker, and how to write your own command with a signature, arguments, options and output.

Routing and Controllers

  1. 7 Routing Basics Learn Laravel routing: routes/web.php, HTTP verbs, closures, route parameters, optional parameters, constraints, named routes and route:list, with a mini router.
  2. 8 Route Groups and Model Binding Share prefixes, names and middleware with route groups, then let Laravel turn URL segments into Eloquent models with implicit, explicit and scoped binding.
  3. 9 Controllers Learn Laravel controllers: make:controller, single-action and resource controllers, constructor and method injection, and controller middleware, plus a runnable dispatcher.
  4. 10 Requests and Responses Read input, files, headers and JSON from the Laravel Request, then return strings, views, JSON, redirects, cookies and downloads, with runnable Request and Response stand-ins.
  5. 11 Middleware Learn Laravel middleware: make:middleware, handle() and $next, global, group and route middleware, parameters, terminable middleware and bootstrap/app.php setup.
  6. 12 The Service Container and Dependency Injection Understand the Laravel service container: automatic resolution, bind and singleton, interface bindings, contextual binding and tagging, with a runnable autowiring container.
  7. 13 Service Providers, Facades and Contracts Learn how Laravel boots through service providers, why register and boot are separate, how facades work via __callStatic, and what contracts are for.

Views and Blade

  1. 14 Blade Templates Learn Blade, Laravel's template engine: echoing and escaping data, @if and @foreach, @forelse, the $loop variable, @php, @json and the danger of raw output.
  2. 15 Layouts, Components and Slots Build reusable Laravel views with Blade components: anonymous and class components, slots, the attributes bag, @props, layouts, @stack and @push, @include.
  3. 16 Forms, CSRF and Assets with Vite Build safe Laravel forms with @csrf, @method, @error and old(), then bundle CSS and JavaScript with Vite and Tailwind 4 using @vite, npm run dev and build.

Validation, Sessions and Files

  1. 17 Validation Validate Laravel requests with validate() and Validator::make, use common rules, nested and conditional rules, after hooks, error messages and validated data.
  2. 18 Form Requests and Custom Rules Move Laravel validation into form request classes: authorize, rules, prepareForValidation, messages, custom ValidationRule objects, Rule::unique, in and enum.
  3. 19 Sessions, Flash Data and Cookies Learn how Laravel sessions work, how to store and read data, flash messages and old input, regenerate session IDs, and how encrypted cookies are protected.
  4. 20 File Uploads and the Storage System Handle file uploads in Laravel with validation, store files on local, public or S3 disks with the Storage facade, link public files and serve downloads safely.

Databases and Migrations

  1. 21 Database Configuration and the Query Builder Configure Laravel's database connections, run raw queries with bindings, build fluent queries with where, join and groupBy, chunk results and use transactions.
  2. 22 Migrations Learn Laravel migrations: create tables with Schema and Blueprint, choose column types, add indexes and foreign keys, alter tables, and run migrate, rollback and fresh.
  3. 23 Seeders and Factories Fill your Laravel database with data: write seeders, define model factories with fake data, use states and sequences, and build related records with has() and for().

Eloquent ORM

  1. 24 Eloquent Models and CRUD Learn Eloquent, Laravel's ORM: create models, follow table naming conventions, create, read, update and delete records, mass assignment with fillable, and upserts.
  2. 25 Querying with Eloquent Query models with Eloquent: local and global scopes, aggregates, chunking and lazy collections, pagination, withCount and subqueries, with runnable PHP stand-ins.
  3. 26 Eloquent Relationships Model one-to-one, one-to-many, many-to-many, has-many-through and polymorphic relationships in Eloquent, and see how a relationship resolver works underneath.
  4. 27 Eager Loading and the N+1 Problem Learn what the N+1 query problem is, how with(), load() and constrained eager loads fix it, and how preventLazyLoading catches it, with a query-counting demo.
  5. 28 Accessors, Mutators and Casts Transform Eloquent attributes on the way in and out: Attribute accessors and mutators, built-in, enum, JSON, encrypted and custom casts, plus appends and hidden.
  6. 29 Model Events, Observers and Soft Deletes React to Eloquent model lifecycle events with observers, keep deleted rows recoverable with SoftDeletes, prune old data, and use UUID or ULID primary keys.
  7. 30 Collections Use Laravel collections to transform data fluently with map, filter, reduce, groupBy, pluck and sortBy, learn higher-order messages and lazy collections, and build your own.

Authentication and Authorization

  1. 31 Authentication Overview and Starter Kits Understand how Laravel authentication works: guards, user providers, the auth config file, starter kits for React, Vue and Livewire, Fortify, and how to choose.
  2. 32 Registering, Logging In and Out Build login, registration and logout in Laravel: Auth::attempt, Auth::login, remember me, session regeneration, password hashing, login throttling and the auth middleware.
  3. 33 Fortify, Email Verification and Password Reset How Laravel Fortify provides the authentication backend: email verification, password reset links, password confirmation, customizing actions, and 2FA and passkeys.
  4. 34 API Authentication with Sanctum Secure your Laravel API with Sanctum: personal access tokens, abilities, expiring and revoking tokens, cookie authentication for SPAs, and when to choose Passport.
  5. 35 Gates and Policies Learn Laravel authorization: Gate::define, policies made with make:policy, authorize in controllers, @can in Blade, policy responses, guests and before hooks.
  6. 36 Roles and Permissions Patterns Design roles and permissions in Laravel: enum roles, role and permission pivot tables, permission checks in policies, team-scoped roles and when to use a package.

Queues, Events and Notifications

  1. 37 Queues and Jobs Move slow work out of the request with Laravel queues. Learn jobs, dispatching, workers, retries, backoff, failed jobs, unique jobs, chains and batches.
  2. 38 Events and Listeners Learn Laravel events: event classes, listeners, queued listeners, subscribers, afterCommit, and Event::fake, with a runnable dispatcher stand-in.
  3. 39 Sending Mail Send email in Laravel with Mailable classes: envelope, content, Markdown mail, attachments, queued mail, the log driver for local work, and Mail::fake.
  4. 40 Notifications Send one message through many channels with Laravel notifications: via(), mail, database, Slack and broadcast channels, queued delivery and testing.
  5. 41 Task Scheduling Run recurring jobs with the Laravel scheduler: routes/console.php, frequency helpers, withoutOverlapping, onOneServer, the single cron entry and schedule:work.
  6. 42 Real-Time Features with Broadcasting and Reverb Push live updates to the browser with Laravel broadcasting: broadcast events, public, private and presence channels, authorization, Reverb and Echo.

Caching and Performance

  1. 43 Caching in Laravel Learn Laravel caching - cache stores, Cache::remember, TTLs, tags, atomic locks, invalidation on write, and the rate limiter, with runnable PHP stand-ins.
  2. 44 Performance and Optimization in Laravel Make a Laravel app fast - optimize commands, config and route caches, query counts and indexes, queues for slow work, OPcache, Octane, Telescope and Debugbar.

APIs

  1. 45 Building JSON APIs with API Resources in Laravel Build a JSON API in Laravel with install:api, apiResource routes and JsonResource classes, including collections, conditional fields, pagination and HTTP status codes.
  2. 46 API Design: Errors, Pagination, Filtering and Versioning Design a Laravel API clients enjoy - consistent JSON errors, exception rendering, cursor pagination, safe filtering and sorting, rate limits, versioning and OpenAPI.
  3. 47 The HTTP Client and Consuming APIs in Laravel Call other APIs from Laravel with the Http facade - JSON, headers and tokens, timeouts, retries, throw, concurrent pools, macros and Http::fake in tests.

Livewire and the Frontend

  1. 48 Livewire Basics Learn Livewire 4 in Laravel - components, properties, actions, wire:model, wire:click, validation, lifecycle hooks, pagination and single-file components.
  2. 49 Blade, Livewire, Inertia or an SPA? Compare the four ways to build a Laravel frontend - Blade, Livewire, Inertia and a separate SPA - see what each sends over the wire and learn how to choose.

Testing

  1. 50 Testing with Pest Learn to test Laravel apps with Pest - feature and unit tests, artisan test, expectations, datasets and hooks, plus a tiny runnable Pest-style test runner.
  2. 51 HTTP and Database Tests Test Laravel routes and the database - get() and post() helpers, assertStatus, assertJson, RefreshDatabase, factories, actingAs and assertDatabaseHas.
  3. 52 Faking Mail, Queues, Events, HTTP and Time Learn Laravel's fakes - Mail, Queue, Event, Http and Storage fakes, freezeTime and Mockery - and how the fake-facade pattern works with a runnable example.
  4. 53 Browser Tests, Static Analysis and Code Style Go beyond feature tests with Pest browser testing, Larastan static analysis, Pint code style, Rector upgrades and a GitHub Actions CI pipeline.

Security, Errors and Deployment

  1. 54 Security in Laravel Learn how Laravel protects against CSRF, XSS, SQL injection and mass assignment, and how to use encryption, rate limiting, security headers and safe uploads.
  2. 55 Logging, Exceptions and Error Handling in Laravel Learn Laravel logging channels and levels, context data, how to report and render exceptions in bootstrap/app.php, and maintenance mode, with runnable stand-ins.
  3. 56 Deploying Laravel to Production Deploy a Laravel app safely - Laravel Cloud, Forge or a VPS, nginx and PHP-FPM, secrets, optimize commands, Supervisor workers, zero-downtime releases and backups.

Architecture and Extending

  1. 57 Architecture in Laravel: Actions, Services and DTOs Slim down fat Laravel controllers with action classes, services and DTOs, learn when repositories are not worth it, and use events to decouple side effects.
  2. 58 Packages and Extending Laravel Use Composer packages, understand auto-discovery, add behavior with macros, write a small Laravel package with a service provider and publishable config.
  3. 59 Localization, Time Zones and Multi-Tenancy in Laravel Translate Laravel apps with lang files and pluralization, switch locales, handle time zones with Carbon, and isolate tenant data with global scopes.

Projects

  1. 60 Project: A Blog with Authentication in Laravel Build a Laravel blog step by step with a starter kit, migrations, relationships, policies, validation, Blade views, pagination and Pest tests, plus a runnable core.
  2. 61 Project: A REST API with Sanctum Build a versioned, token-protected bookmarks API in Laravel 13 with Sanctum, API resources, validation, rate limiting and Pest feature tests, step by step.
  3. 62 Project: A Task Manager with Livewire Build a task manager with Livewire in Laravel 13, with a create form, live search and filters, policies, a status workflow and queued reminders, plus tests.
  4. 63 Project: A URL Shortener with Queues and Caching Build a URL shortener in Laravel 13 with slug generation, a cached redirect route, click counting in queued jobs, scheduled cleanup and Pest tests.
  5. 64 Project: Subscriptions, Billing and an Admin Panel Add paid subscriptions to a Laravel 13 app with Cashier, from checkout, webhooks, subscription gates, invoices and a Filament admin panel, with tested logic.

Practice and Review

  1. 65 Practice Exercises with Solutions Twelve Laravel exercises on routing, validation, Eloquent, authorization, queues, caching and testing, each with a worked solution and runnable stand-ins.
  2. 66 Laravel Interview Questions Prepare for a Laravel interview with clear answers on the request lifecycle, the service container, Eloquent, queues, security and performance, plus tips.
  3. 67 Laravel Cheat Sheet A one-page Laravel 13 cheat sheet: Artisan commands, routing, validation rules, Eloquent, relationships, Blade, queues, caching and testing, with runnable stand-ins.