Laravel is a PHP framework for building web applications and APIs with a clear structure and a lot of batteries included. Routes map URLs to controllers, Blade templates render HTML, and the Eloquent ORM lets you treat database rows as PHP objects with relationships like hasMany and belongsTo. The Artisan command line tool generates models, controllers and migrations, runs queued jobs and opens an interactive shell called Tinker. Because the conventions are consistent, a beginner can ship a working app with login in a weekend. Learnr turns Laravel into a personalized course of short, interactive lessons you can do daily.
How to learn Laravel, step by step
- Get comfortable with modern PHP and Composer. Laravel leans on classes, namespaces, type hints and closures, so review those in plain PHP first. Learn how Composer installs packages and autoloads classes, because every Laravel project starts with a composer create-project command.
- Create a project and trace one request. Start the dev server with php artisan serve and follow a URL from routes/web.php into a controller and back out as a Blade view. Knowing where routes, controllers, views and config live removes most early confusion.
- Build a CRUD feature with Eloquent. Run php artisan make:model Post -mc to get a model, migration and controller together. Write the migration, migrate, then build list, create, edit and delete pages, using route model binding and mass assignment rules on the way.
- Add validation, relationships and auth. Validate input with $request->validate or form request classes and show the errors in Blade. Link posts to users with belongsTo and hasMany, then add login with a starter kit such as Breeze and restrict routes with the auth middleware.
- Write feature tests as you go. Laravel ships with testing helpers that fake HTTP requests and use a fresh database. Write a test that posts a form and asserts the database has the row, and run them with php artisan test after every change.
- Learn queues, mail and deployment. Move slow work such as sending emails into queued jobs, then deploy to a server with the right .env settings and cached config. Short Learnr lessons help Eloquent methods and Artisan commands stick between projects.
What you'll learn
- Define routes and controllers that respond to web and API requests
- Render pages with Blade layouts, components and loops
- Model data with Eloquent, migrations and relationships
- Validate form input and protect routes with middleware and auth
- Run background work with queues and test features with Pest or PHPUnit
How long does it take to learn Laravel?
If you already write PHP, you can build a small Laravel app in 2 to 4 weeks at 5 hours a week. Coming from no PHP at all, plan on 2 to 3 months including the language. Advanced topics like queues, events and package development take longer.
What you need before you start
Working knowledge of PHP, including classes and arrays, plus basic HTML and SQL. You also need PHP and Composer installed, or a local tool such as Laravel Herd or Docker.
Common mistakes to avoid
- Putting all logic inside route closures or giant controllers. Move validation to form requests and reusable logic to classes so the app stays readable.
- Triggering N+1 queries by looping over models and loading relationships one at a time. Eager load with with() when you know you need related data.
- Committing the .env file or leaving APP_DEBUG on in production, which can expose secrets and stack traces to visitors.
How Learnr builds your course
Type your topic
Tell Learnr you want to learn Laravel, or get as specific as you like.
Get a personalized course
Learnr instantly builds a full Laravel course tailored to your goal and skill level.
Learn and level up
Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.
Laravel questions, answered
Do I need to learn PHP before Laravel?
Yes, at least the basics. Laravel is PHP code, so you need variables, arrays, functions, classes and namespaces. A few weeks of plain PHP makes the framework far less magical.
Is Laravel good for APIs?
Yes. API routes return JSON from Eloquent models or resource classes, and Sanctum handles token or cookie based authentication. Many teams use Laravel as the backend for a separate JavaScript or mobile frontend.
What is the difference between Laravel and plain PHP?
Plain PHP gives you the language and nothing else. Laravel adds routing, an ORM, templating, validation, auth, queues and testing tools with agreed conventions, so you write less boilerplate.
Explore more courses
More programming and tech courses
- Learn Spring Boot
- Learn Ruby on Rails
- Learn Flask
- Learn FastAPI
- Learn Express.js
- Learn Three.js
- Learn WebAssembly
- Learn Solidity
See all programming and tech courses
Ready to learn Laravel?
Start your free, personalized Laravel course in seconds. It will be typed in and ready when you get there.
Start learning LaravelFree to start. No credit card.