Laravel · Intermediate

Laravel Fundamentals

Go from plain PHP to a structured framework: routing, controllers, Blade templates, and talking to a database with Eloquent.

Units
4
Lessons
20
Practice questions
61
Minutes
~300

Start learning today

Try every course free for 7 days. After that, this course is in Learnix Pro (KES 699/month).

Create free account Log in

What you'll learn

Understand the MVC pattern and why frameworks use it

Define routes and connect them to controllers

Render views with Blade templating

Define an Eloquent model and migration

Perform basic CRUD through Eloquent

How the lessons work

Clear explanations

Step-by-step lessons in plain language

45 in this course

Worked examples

Real code and examples you can copy and run

67 in this course

Quick checks

Test your understanding as you go

38 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

  1. 1.1

    What is Laravel, and why use a framework?

    Laravel gives a PHP application a well-tested structure to follow (MVC), so you spend your time on YOUR app's actual logic instead of reinventing routing, security and database plumbing from scratch every time.

  2. 1.2

    Routing Basics

    A route is simply a rule that says "when a visitor asks for this URL, run this code": it's the very first stop every single request makes inside Laravel.

  3. 1.3

    Controllers

    Once a route needs to do anything more than return a one-liner, that logic moves out of routes/web.php and into its own Controller class: a dedicated, organized home for it.

  4. 1.4

    Blade Templating

    Blade is Laravel's templating engine: it looks and behaves like ordinary HTML, with a small, friendly set of extra syntax bolted on for displaying data and handling loops and conditions.

  5. 1.5

    Layouts & Blade Components

    Stop copy-pasting headers and buttons. Build one layout and reusable components so every page stays consistent.

  1. 2.1

    Eloquent Models & Migrations

    A migration writes down a database table's structure as version-controlled PHP code, and an Eloquent model then gives you a clean, object-oriented way to actually query that table.

  2. 2.2

    Basic CRUD with Eloquent

    Create, Read, Update, Delete: the four operations practically every application performs on its data, and with Eloquent each one usually takes just one or two lines of PHP.

  3. 2.3

    Eloquent Relationships: hasMany, belongsTo, and Many-to-Many

    Real data is connected: a course has many lessons, a lesson belongs to one course, and a student can enroll in many courses while each course has many students. Eloquent relationships describe these connections directly on your models, so you can traverse them like ordinary properties.

  4. 2.4

    Eloquent Queries, Scopes, Pagination & N+1

    Write expressive queries, reuse filters with scopes, paginate lists, and fix the N+1 problem that silently slows down most Laravel apps.

  5. 2.5

    Factories & Seeders: Realistic Test Data

    Fill your database with hundreds of realistic records in seconds, for development, demos and tests.

  1. 3.1

    Form Requests: Clean, Reusable Validation

    Validating input directly inside a controller method works, but it clutters the method fast: a Form Request class moves all of that validation logic into its own dedicated, reusable place.

  2. 3.2

    Middleware: Filtering Requests Before They Reach a Controller

    Middleware sits between an incoming request and your controller, like a security checkpoint: it can inspect, block, or modify a request before it's allowed to continue, or do the same to the response on its way back out.

  3. 3.3

    Authentication: Login, Registration & Breeze

    Add secure registration, login, password reset and email verification in minutes with Laravel Breeze, then protect pages for signed-in users.

  4. 3.4

    Authorization: Gates, Policies & Roles

    Decide who may do what: owners edit their own posts, admins manage everything, and everyone else gets a 403.

  5. 3.5

    Handling File Uploads

    Letting a visitor upload a file (a profile photo, a document) needs a form that says so explicitly, validation that checks what actually arrived, and a deliberate decision about where the file ends up being stored.

  1. 4.1

    API Resources: Returning JSON from a Controller

    Not every response needs to be an HTML page: an API Resource shapes an Eloquent model (or a whole collection of them) into exactly the JSON structure you want to hand back to a mobile app, a JavaScript frontend, or any other API consumer.

  2. 4.2

    Emails & Notifications

    Send order confirmations, password codes and reminders by email (and SMS or database) with Mailables and Notifications.

  3. 4.3

    Queues & the Task Scheduler

    Move slow work (emails, PDFs, M-Pesa checks) into background jobs, and run tasks on a timetable with one cron entry.

  4. 4.4

    Feature Tests with PHPUnit

    Prove your pages, forms and permissions work, and keep working, with Laravel's fast feature tests.

  5. 4.5

    Deploying Laravel to the Internet

    Put your app online on shared hosting (cPanel) or a VPS, with the right environment settings, caches, cron and security.

Earn a verifiable certificate

Finish every lesson and pass the 20-question final exam (70% to pass). Each certificate has a unique number anyone can check online.

Get started

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.