Free Online Course · Self-paced · Hands-on

Laravel Tutorial for Beginners (Step by Step)

Free Laravel tutorial with 60+ hands-on lessons: install, routing, Blade, Eloquent, auth with Sanctum and Passport, REST APIs, queues, and Docker deploys.

  • 10 chapters
  • 64 lessons
  • ~15h
  • Beginner to Intermediate
  • Tested with Laravel 10.x
  • Updated Sep 2026
Laravel Tutorial for Beginners (Step by Step)
By Last updated

About this course

This free course takes you from a fresh Ubuntu install to a deployed Laravel app, one framework feature per lesson. It covers routing and Blade, Eloquent and migrations, authentication and authorization, validation, storage and mail, APIs, performance tooling, and deployment. When a lesson skips an option, the official Laravel documentation is the place to look it up.

The lessons that build something start from a new composer create-project app and finish with a page you can open in the browser or an endpoint you can call from Postman, so you are never left fitting a snippet into code you cannot see. Most of them were written against Laravel 10. Routes, Eloquent, Blade, and validation work the same way on Laravel 13, and the FAQ below lists the few places where newer releases moved things.

If Laravel is new to you, work through Getting Started and the Eloquent chapter before you touch authentication, because every later lesson assumes you can create a model and run a migration. If you already ship Laravel apps, jump straight to Sanctum, Octane, or the Deployment chapter.

What you'll learn

  • Install Laravel on Ubuntu, fix URL, timezone, and file permission issues, and upgrade an existing project
  • Build route groups, Blade views, and custom helpers
  • Model data with migrations and Eloquent, including relationship queries, eager loading, soft deletes, and pagination
  • Add login with Breeze or Jetstream, secure APIs with Sanctum or Passport, and authorize with gates, policies, and spatie/permission
  • Validate requests, manage files on storage disks, send mail, and generate PDFs
  • Build REST and GraphQL APIs and call external services from Laravel
  • Speed up and monitor an app with caching, Debugbar, Octane, Horizon, Pennant, and scheduled tasks
  • Run Laravel in Docker or Sail and deploy it with Forge

Who this course is for

  • PHP developers who write plain PHP today and want routing, an ORM, and authentication without building them by hand
  • Backend developers building REST or GraphQL APIs for a mobile app or a JavaScript front end
  • Full-stack developers deciding between Breeze, Jetstream, Sanctum, and Passport for a real project
  • Developers who inherited a Laravel codebase and need to find their way around Eloquent, migrations, and queues

Prerequisites

  • Working PHP knowledge, including classes, namespaces, arrays, and installing packages with Composer
  • Basic HTML and SQL, enough to read a SELECT with a JOIN
  • A Linux, macOS, or WSL machine with PHP, Composer, and Node.js with npm for front-end builds
  • MySQL or MariaDB for the database chapters (SQLite is enough for the first four). Forge and Nova are paid Laravel products; every other lesson uses free tools

Versions and testing environment

Every command in this course was run on this stack

ComponentVersionNotes
Laravel 10.x The version most lessons were written against. Routing, Eloquent, Blade, and validation carry over to Laravel 13; see the FAQ for what moved
PHP 8.1+ The Docker lesson builds on the official PHP 8.1 Apache image. Laravel 13 needs PHP 8.3 or newer
Composer 2.x Every project in the course starts from composer create-project laravel/laravel
Ubuntu, Apache, and MariaDB — The stack the installation lesson sets up from the Ubuntu package repositories

Syllabus

10 chapters · 64 lessons · ~15h of reading

  1. 1 Getting Started 7 lessons · ~51 min
    1. Part 1 Install Laravel 7 min read
    2. Part 2 Run your first Laravel project 7 min read
    3. Part 3 Upgrade Laravel to the latest version 6 min read
    4. Part 4 Remove /public from Laravel URLs 12 min read
    5. Part 5 Get the base URL in Laravel 5 min read
    6. Part 6 Change the Laravel timezone 5 min read
    7. Part 7 Set correct file permissions for Laravel 9 min read
  2. 2 Routing, Blade and Helpers 5 lessons · ~38 min
    1. Part 8 Route groups and array parameters 14 min read
    2. Part 9 Set variables in a Blade template 6 min read
    3. Part 10 Show a newline in Blade output 6 min read
    4. Part 11 Create a custom Laravel helper 6 min read
    5. Part 12 timeSince() helper in Laravel 6 min read
  3. 3 Eloquent ORM and Database 16 lessons · ~2h 9m
    1. Part 13 Laravel Eloquent ORM tutorial 15 min read
    2. Part 14 Laravel migrations explained 10 min read
    3. Part 15 Add a new column to an existing table 9 min read
    4. Part 16 Make a column nullable in a migration 4 min read
    5. Part 17 Select specific columns with Eloquent 7 min read
    6. Part 18 Use whereIn() with Eloquent 5 min read
    7. Part 19 whereHas() for relationship constraints 15 min read
    8. Part 20 withCount() for related-row counts 7 min read
    9. Part 21 Get the last inserted ID 6 min read
    10. Part 22 Laravel soft delete 10 min read
    11. Part 23 Disable Eloquent timestamps 6 min read
    12. Part 24 Eager loading inside foreach loops 13 min read
    13. Part 25 Recursively find values in an array 6 min read
    14. Part 26 Sort by pivot table columns 10 min read
    15. Part 27 Sort by multiple columns 6 min read
    16. Part 28 Set up Laravel pagination Coming soon
  4. 4 Authentication and Authorization 11 lessons · ~1h 40m
    1. Part 29 Laravel authentication explained 12 min read
    2. Part 30 Laravel Breeze - lightweight auth scaffold 6 min read
    3. Part 31 Laravel Jetstream 8 min read
    4. Part 32 Laravel Sanctum - SPA and API tokens 8 min read
    5. Part 33 Laravel Passport - full OAuth2 server 20 min read
    6. Part 34 Customize auth routes in Laravel 8+ 9 min read
    7. Part 35 Reset password flow in Laravel 6 min read
    8. Part 36 Hash and verify passwords 7 min read
    9. Part 37 Gates and policies for authorization 8 min read
    10. Part 38 Role-based permissions with spatie/permission 8 min read
    11. Part 39 Check user online/offline status 8 min read
  5. 5 Validation, Storage and Mail 7 lessons · ~1h 1m
    1. Part 40 Laravel validation tutorial 14 min read
    2. Part 41 Use the "in" validation rule 6 min read
    3. Part 42 Laravel storage disks 8 min read
    4. Part 43 Delete a file with Laravel 6 min read
    5. Part 44 Send emails in Laravel 13 min read
    6. Part 45 Laravel gallery management 10 min read
    7. Part 46 Generate PDFs in Laravel 4 min read
  6. 6 APIs and Integrations 5 lessons · ~38 min
    1. Part 47 Create a REST API in Laravel 7 min read
    2. Part 48 Create a GraphQL API in Laravel 13 min read
    3. Part 49 Call external APIs from Laravel 5 min read
    4. Part 50 Laravel Kafka integration tutorial 5 min read
    5. Part 51 Real-time UI with Laravel Livewire 8 min read
  7. 7 Performance, Logs and Tooling 6 lessons · ~45 min
    1. Part 52 Clear the Laravel cache 5 min read
    2. Part 53 Clean and rotate Laravel logs 6 min read
    3. Part 54 Debug with Laravel Debugbar 6 min read
    4. Part 55 Laravel Octane for high performance 11 min read
    5. Part 56 Manage queues with Laravel Horizon 6 min read
    6. Part 57 Feature flags with Laravel Pennant 11 min read
  8. 8 Background Jobs and Scheduling 1 lesson · ~13 min
    1. Part 58 Set up a cron schedule for Laravel 13 min read
  9. 9 Admin Tooling and Boilerplates 3 lessons · ~29 min
    1. Part 59 Voyager - Laravel admin panel 4 min read
    2. Part 60 Laravel Nova admin panel 16 min read
    3. Part 61 Laravel boilerplate starter 9 min read
  10. 10 Deployment 3 lessons · ~27 min
    1. Part 62 Run Laravel in Docker 12 min read
    2. Part 63 Laravel Sail tutorial 7 min read
    3. Part 64 Deploy with Laravel Forge 8 min read

Hands-on labs

6 guided builds you run yourself

  1. Install Laravel on Ubuntu with Apache and MariaDB

    Install PHP and its extensions, MariaDB, and Composer, create a project, and serve it through an Apache virtual host.

  2. Build a REST API with a model, migration, and controller

    Generate the model and migration, wire resource routes to a controller, and test every endpoint from Postman.

  3. Protect API routes with Sanctum tokens

    Add Breeze-based authentication controllers and routes, issue tokens, and confirm that protected endpoints reject anonymous requests.

  4. Build and test a GraphQL API

    Install a GraphQL package, define the schema for your models, and run queries and mutations against it.

  5. Build an image gallery with uploads

    Upload, resize, store, and display images with Laravel storage and the Intervention Image library.

  6. Run a Laravel app in Docker

    Containerize a project two ways, including a multi-stage build that uses the official Composer and PHP images.

Where to go after this course

  • Laravel documentationThe upgrade guide and per-version docs are where to check anything that changed after the Laravel 10 examples.
  • SQL courseEloquent writes the SQL for you, and reading it is how you debug slow or wrong queries.
  • Node.js courseVite, npm, and the starter kit front ends all run on Node.js.
  • Ansible courseAutomate the PHP-FPM, web server, and database setup once you deploy to more than one server.

Frequently Asked Questions

Which Laravel version should I install?

Install Laravel 13 for a new project. It was released on March 17, 2026, supports PHP 8.3 to 8.5, and gets bug fixes until Q3 2027 and security fixes until March 17, 2028. Laravel 12 still receives security fixes until February 24, 2027, and Laravel 10 reached end of life in February 2025, so only use it to maintain an existing app. Laravel publishes these dates in its support policy, which is worth checking before you start a long project.

Do the Laravel 10 examples still work on Laravel 11, 12, and 13?

Most of them do. Laravel 11 slimmed down the application skeleton, so there is no app/Http/Kernel.php any more. Middleware, exception handling, and routing are configured in bootstrap/app.php instead. When a lesson registers middleware in the kernel, register it in bootstrap/app.php on newer versions. Laravel 13 also raises the minimum PHP version to 8.3. Read the upgrade guide for the version you are moving to before you upgrade a real project.

Should I still use Laravel Breeze or Jetstream?

For a new app, use the current starter kits instead. Since Laravel 12 the framework ships starter kits for React, Vue, Svelte, and Livewire, and Breeze and Jetstream no longer receive updates. The Breeze and Jetstream lessons are still useful because the starter kits are built on the same Laravel authentication features: login, registration, password reset, and email verification.

What is the difference between Sanctum and Passport?

Sanctum issues simple API tokens and handles cookie-based authentication for your own single-page app or mobile app. Passport is a full OAuth2 server, which you need when third-party applications must request access to your users' data. If you are only securing your own front end, start with Sanctum.

Do I need to know PHP before learning Laravel?

Yes, at least the basics. Laravel code is object-oriented PHP, so you should be comfortable with classes, namespaces, arrays, and closures, and know how Composer installs and autoloads packages. You do not need to have built a large PHP application first.

Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with 15+ years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, networking, and security, delivering robust and efficient solutions for diverse projects.

  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security
  • Cloud Computing
  • Kubernetes
  • Linux
  • Ansible (software)