Laravel
From routes, the service container and Eloquent to collections, Livewire, Inertia, testing, packages and deployment, Laravel as told through the free samples of Leanpub books.
Created from the free samples of 15 Leanpub books and the descriptions and tables of contents of 12 more, with every source cited.
Laravel is an open-source framework for building web applications in PHP. It supplies the parts most applications need (routing of requests, controllers, a template language, an object-relational mapper for the database, validation, sessions, queues and mail) behind an interface designed to be pleasant to write, and it places a service container at the centre through which the parts are assembled.[2][1] None of it is outside the language. One book's first chapter is titled to say that Laravel is not magic: every facility wraps something core PHP already does, a route registering an ordinary callable and a model sitting on the standard database interface.[14]
The framework is large and has grown a surrounding ecosystem. A recent introduction warns that the learning curve is steep for someone meeting this kind of framework for the first time, because there are so many components and several ways of doing the same thing, and adds that where the framework lacks something a package usually exists for it.[11] The books reflect that spread: beside the introductions there are books on the helper functions alone, on the two front-end layers that now ship as starting points, on testing, on writing packages, on servers, and on a content management system built on top.[5][12][19][7]
This article covers the framework's versions, setting up, routes and views, the container and dependency injection, data and collections, helpers, the front end, authentication and interfaces for other programs, testing, packages and architecture, project books, and deployment. Its sources are the free samples of fifteen Leanpub books and the descriptions and tables of contents of twelve more, published between 2013 and 2026. Laravel releases a new major version roughly every year, so most of the older books are tied to a version long out of support; each carries its year, and the older ones are cited for what has not changed.
Where to start
A PHP developer new to Laravel has introductions from every period. Laravel 13 from scratch: Full Stack web development with Vue 3 and Tailwind CSS (2026) introduces Laravel 13 by building a blog with an administration area, a programming interface for other clients and a front end that consumes it; its author advises some experience of another PHP framework first.[11] The Laravel Survival Guide (2019) is a brief guide to the basics, one short chapter to a topic.[10] Laravel: Code Smart (2016) is a conversational beginner's book on Laravel 5, written, in its author's words, as if between two friends in a bar.[2] A Collection of Laravel Tutorials (2018) is a set of standalone tutorials whose first course builds a small business website in the fewest steps that will work.[9] Laravel 5.4 For Beginners (2017) is a step-by-step book of more than nine hundred pages built around one sample application.[27]
A reader whose PHP is shaky can go underneath first. PHP for Laravel Developers: The Core You Missed (2025) teaches core PHP through the things Laravel wraps: request handling, sessions, file access, dependency injection.[14]
The rest assume the framework. Laravel: From Apprentice To Artisan (2013) is about structuring larger applications and is still read for its account of dependency injection.[1] Full-Stack Laravel 13 and Livewire 4 + IA + Alpine.js: Build real applications from scratch (2026) and Full-Stack Laravel 13 and Inertia 3: Build real applications from scratch with Vue 3 (2026) each tell readers who have not worked with plain Laravel to learn it first.[12][13] Building SaaS with Laravel (2019) expects the basics and builds a paid product.[4] Laravel 12 Cookbook, Second Edition (2026) is a book of recipes for developers running production applications.[25]
Versions
The books trace the framework's history by their titles. The oldest source was written for Laravel 4.[1] A group from 2015 to 2018 covers the 5.x series, and one of them marks 5.1 as the first release with long-term support, with bug fixes for two years and security fixes for three.[3] The newest books cover Laravel 12 and 13.[25][11]
Authors are frank about how fast their work dates. One declines to print installation instructions because they change from week to week.[2] A reference to the string helpers records the exact patch release it was written against and notes where the previous major version differed.[6] One author has marked a 2019 book as outdated in its own subtitle, and another says of a 2024 book that its Laravel material has aged while its concepts still apply.[4][26] Two of the 2026 books show the same thing from the other side: their titles name the newest versions while their samples are dated a year earlier and name the versions before.[12][13]
Setting up
Laravel depends on Composer, PHP's dependency manager, which downloads the framework and every library it uses; one book explains it as ordering a pizza by listing the toppings wanted.[10][2] A new project is created with a single command, through Composer or through the framework's own installer.[2][10]
The local environment has changed more than anything else in the books. The 5.x-era books favour Homestead, a prepared virtual machine managed by Vagrant on top of VirtualBox, which gives the same environment on any operating system; one compares the three to a car's driving seat, frame and engine.[3][2] Valet, a lighter tool that serves projects with the PHP already installed on a Mac, appears as the alternative, and packaged web-server stacks are mentioned for those who prefer them.[2][10] One tutorial simply uses the built-in development server to get going.[9]
Two points of first setup recur. The web server must point at the project's public directory and never at the project root, so that application code and configuration cannot be requested directly; and the application key has to be generated, because it is what encrypts sessions and cookies.[8]
Routes, controllers and views
A route binds a URL and a request method to the code that answers it, and the routes file serves as an index of the site: to find out what a URL does, one looks there.[9] The answering code can be a short anonymous function or a method on a controller.[8] A route may contain parameters, including optional ones, and a condition can restrict a parameter to a pattern, such as digits only for a record's key, so that a malformed URL never reaches the code.[8] By convention the method matches the action: GET to read, POST or PUT to change, DELETE to remove, and a set of such routes over one kind of record forms the interface that a front end or another program calls.[8]
Views are written in Blade, the framework's template language, in files the routes or controllers return by name.[9] Controllers sit between the two, and several sources insist on keeping them thin. They mediate between HTTP and the application and should not hold its business logic; one book offers the image of a monitor with several cable ports, where the web is only one cable into the application.[1] A recent introduction observes that the framework's Model-View-Controller pattern is no longer strictly that, given the number of paths a developer can take.[11]
The container and dependency injection
Laravel: From Apprentice To Artisan calls the service container the foundation of the framework and then puts it in its place: a container is a convenience for a design practice, dependency injection, which can be done without one.[1] The book's example is a controller that fetches users through the object-relational mapper directly. The code is short, but it cannot be tested without a live database, and the controller knows where the data lives when it needs only to know how to ask for it.[1] The remedy is to define an interface for the data access, have the controller receive an implementation through its constructor, and bind the real one in the container. The controller can then be tested with a mock, and the storage behind it changed without touching it.[1]
The same chapter is careful about the cost. Interfaces mean more to type, and for a small application whose implementation will not change it is acceptable to couple to it directly; the pure architecture the book presents is meant to be scaled back where it does not pay.[1] PHP for Laravel Developers: The Core You Missed lists the container among the things Laravel wraps, its plain equivalent being dependency injection done by hand.[14]
Data and collections
Eloquent is the framework's object-relational mapper, in which each table has a model class and each row is an object; the sources mention it in every introduction's contents and none of the samples teaches it at length.[2][11] What the pool does cover in depth is the Collection class, the object that query results and many other lists arrive in. Laravel Collections Unraveled (2017) is a thirty-page pamphlet that groups its methods by what they do (imitating arrays, sorting, filtering, looping and transforming), distinguishes the general collection from the one Eloquent returns, and looks at the PHP iterator interfaces underneath.[16] Laravel Companion: Second Edition (2018) includes the collection interface in its function-by-function reference.[5]
Helpers and strings
A good deal of Laravel's reputation for comfort rests on small helper functions. Laravel Companion: Second Edition documents them one at a time, with signature and examples, on the ground that common string operations in PHP look more obscure than they are. The string helpers treat their input as immutable and return a modified copy, and they cover conversions between naming styles (studly, camel, snake and kebab case), extraction of the text before or after a marker, and transliteration to ASCII.[5] The same reference explains how translation strings are stored, in PHP files of keys and values in one directory per locale, or in JSON files.[5]
Advanced PHP Strings: Text analysis, generation, and parsing via. Laravel (2022) takes the subject as far as it goes. It is organised around the framework's string helpers, sorted into those that format, those that test, those that construct and those that extract, starts from the difference between counting bytes and counting characters in multibyte text, and ends with applied chapters that build parsers, one of which validates directives in Blade templates.[6]
The front end
Laravel renders HTML on the server with Blade, and the books show three ways of adding interactivity. The oldest is a separate JavaScript application that talks to Laravel over HTTP. Laravel and AngularJS (2022, on versions of both tools from several years earlier) builds that arrangement, with Laravel reduced to a set of routes returning data.[8] Laravel 13 from scratch: Full Stack web development with Vue 3 and Tailwind CSS does the same with Vue 3.[11]
The two newer ways are layers the framework offers when a project is created. Livewire lets a developer build dynamic interfaces out of server-side components, with behaviour of the kind associated with Vue or React and without leaving Laravel; its book is plain that Livewire is a layer over the framework and not a framework itself, and that a Livewire project comes with a CSS framework and a small JavaScript library already configured.[12] Inertia takes the other direction: pages are Vue components used as if they were Blade views, driven by ordinary server-side routes and controllers, which gives a single-page application without a separate interface layer to maintain.[13] Both books are built from the same projects (record management screens, a multi-step form, filters and sorting, a blog, a shopping cart) so that the two approaches can be compared.[12][13]
Authentication and programming interfaces
Authentication is where beginners most often stop understanding what the framework has done for them. Laravel 12 Authentication and Authorization from Scratch (2026) is written for the reader who has installed the Breeze starter kit, found that login and registration work, and has no idea why. It follows a user from the registration form to the database, from login to the session, through password reset and email verification to protected routes, and then adds an administration panel with authorisation.[24] The older beginner books build the same features by hand, with sign-in through a social network and access control.[27] Laravel 12 Cookbook, Second Edition has recipes for layered authentication and role-based access with the framework's first-party packages.[25]
For clients other than a browser, Laravel 13 from scratch: Full Stack web development with Vue 3 and Tailwind CSS builds a REST interface protected with Sanctum, the framework's token package.[11] Laravel APIs - Building Better (2025) is a twenty-page overview of practice for such interfaces: route structure, validation, error handling, authentication, performance and security.[23] These three are cited from descriptions and contents.
Testing, packages and architecture
Laravel Testing 101 (2019) starts from a common situation, a working application without a single test, and from the questions that stop people beginning: whether to unit test everything, whether to test only the critical parts, why tests are needed at all. Its answer is the author's own process for a record-management application, starting with what a guest user can see and do.[19] Testability is also the argument of the dependency injection chapter cited above, which mocks a repository to test a controller in isolation.[1]
Reusable code is distributed as packages. Laravel Packages Development (2022) builds one test-first, a chat package that lets the models of any application hold conversations with each other, and covers the pieces a package needs: its Composer definition, a service provider, a facade and model factories for test data.[18] Laravel: The Modular Way (2022) documents a third-party package for splitting one application into modules and then builds on it, including the conversion of a module into a package.[22]
Architecture of complex web applications. Second Edition. (2024) addresses what happens when a project outgrows the simple pattern. It describes the usual drift, in which the view is templates, the model is an active-record class, and all remaining logic (image uploads, calls to outside services, database operations) accumulates in controllers and then in base controllers thousands of lines long, and it works through how developers usually get out, beginning with dependency injection and the single responsibility principle. Its examples are in Laravel and its subject is architecture.[17] All four of these are cited from descriptions and contents.
Building a product
Several books teach by building something that could be sold. Building SaaS with Laravel builds a payment-form service on which sellers connect their accounts with a payment processor and the application takes a fee, and gives as much attention to what precedes the code: validating the idea with the smallest product that works, sketching wireframes on paper before drawing them, and settling a three-model database design.[4] Easy E-Commerce Using Laravel and Stripe (2015) builds an online store for a fictional family business in phases, a basic site, accounts, a catalogue, physical and downloadable products, then subscriptions, and ends each phase with the client questioning the decisions taken.[15] Laravel 5.4 For Beginners reaches a real-time chat feature by the end of its sample application.[27]
A more recent direction is represented by PHP AND LLMs (2025), a guide for PHP developers to integrating large language models, with its examples built in Laravel; it has no sample, and its author notes that the framework details have dated.[26]
Servers and deployment
An application is developed in a local environment and moved to a production server, and the books treat the second half sparingly.[10] Working With Forge Servers (2017) is about the Linux servers that the framework's commercial provisioning service creates, written by someone who had to learn them: where the logs and configuration files are, how to restart or stop the database and the web server, how to add swap space, how to set a project up in version control so that it deploys.[20] Deploy Laravel on AWS with CloudFormation (2017) is a numbered guide to running an application on one public cloud with infrastructure defined in templates, containers, a content delivery network, alarms, automatic scaling and continuous deployment.[21] The author of Building SaaS with Laravel states his own preference for a rented virtual server, the provisioning service and a companion service for deployments without downtime, and reminds the reader to set up automatic backups and error monitoring before going live.[4] Laravel 12 Cookbook, Second Edition ends with queues, scheduled jobs and maintenance for applications in production.[25]
Built on Laravel
The framework is also a platform for other products. Antlers (2023) is about the template language of a content management system built on Laravel. A template is HTML with expressions in double curly braces: variables that print data, modifiers that transform it, and tags, usually in pairs, that fetch content from the system or loop over a list. A variable that is not defined at the current level is looked for further out, a rule the system calls the cascade.[7] The language is more than ten years old, descends from the template language of an earlier system, and has borrowed from Blade.[7] The book is about that system and not about Laravel code, which is a fair picture of how far the ecosystem now extends.
Questions about Laravel
Which Laravel book should I start with?
For a current version, Laravel 13 from scratch: Full Stack web development with Vue 3 and Tailwind CSS (2026) introduces Laravel 13 by building a blog, an interface for other clients and a Vue front end.[11] A reader whose PHP is weak can begin with PHP for Laravel Developers: The Core You Missed (2025), which teaches the core PHP that Laravel wraps.[14] The older introductions, such as Laravel: Code Smart (2016), are tied to Laravel 5.[2]
What is the service container in Laravel?
The container is the mechanism that builds objects and supplies their dependencies, and one source calls it the foundation of the framework.[1] It is a convenience for dependency injection, which can be practised without a container: a class receives what it needs from outside instead of creating it.[1]
What is the difference between Livewire and Inertia?
Livewire builds dynamic interfaces from server-side Laravel components, with no separate JavaScript application.[12] Inertia uses Vue components as the pages, driven by ordinary server-side routes and controllers, to produce a single-page application.[13] Both are layers over the framework, and both books expect the reader to know plain Laravel first.[12][13]
Do I need to know PHP before learning Laravel?
It helps. Everything Laravel does it does with core PHP underneath: a route registers an ordinary callable, and the framework's request, storage and session facilities wrap native ones.[14] A recent introduction also advises experience of another PHP framework first, because Laravel has many components and a steep learning curve.[11]
Why should controllers be kept thin?
A controller mediates between HTTP and the application, and logic placed in it is tied to the web and hard to test.[1] A controller coupled directly to the database layer cannot be tested without a live database, whereas one that receives its data access through an interface can be tested with a mock.[1] One book on architecture describes controllers that grow to thousands of lines as the usual result of putting all remaining logic there.[17]
Are older Laravel books still useful?
For version-specific detail, no: installation steps, tooling and package names have changed, and some authors mark their own books as outdated.[2][4] For ideas that do not depend on a version, such as dependency injection and the structure of a larger application, a 2013 book is still cited here.[1]
Sources
Every source is a Leanpub book or course. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Laravel: From Apprentice To Artisan, Taylor Otwell: Advanced Architecture With Laravel 4 Free sample: the chapter on dependency injection. 2013. Free sample: PDF · EPUB
- 2.Laravel: Code Smart, Dayle Rees: The Laravel Framework Version 5 for Beginners Free sample: the introduction and the chapters on installing dependencies, creating a project and the Homestead environment. 2016. Free sample: PDF · EPUB
- 3.Laravel 5.1 Beauty, PubShare: Creating Beautiful Web Apps with Laravel 5.1 Free sample: the introduction and the chapters on required software and the development environment, before any Laravel code. 2015. Free sample: PDF · EPUB
- 4.Building SaaS with Laravel, Max Kostinevich: [PLEASE NOTE: THE BOOK IS OUTDATED] Learn how to build and launch a real-world SaaS application in just a few weeks. Free sample: the introduction to the project, planning and wireframes, with pages omitted. 2019. Free sample: PDF
- 5.Laravel Companion: Second Edition, Johnathon Koster Free sample: the opening of the reference to string helpers and translation files. 2018. Free sample: PDF · EPUB
- 6.Advanced PHP Strings: Text analysis, generation, and parsing via. Laravel, Johnathon Koster Free sample: the introduction with a summary of every chapter, and the opening of chapter 1. 2022. Free sample: PDF · EPUB
- 8.Laravel and AngularJS, Daniel Schmitz, Daniel Pedrinha Georgii: Learn how to build apps with AngularJS in the client and Laravel on server Free sample: chapter 4 on creating an application and on routes. 2022. Free sample: PDF · EPUB
- 9.A Collection of Laravel Tutorials, Mario Bašić Free sample: the opening of the first course, on installation, routes and views. 2018. Free sample: PDF · EPUB
- 10.The Laravel Survival Guide, Tony Lea Free sample: the introduction and the chapters on the local environment and Composer. 2019. Free sample: PDF · EPUB
- 11.Laravel 13 from scratch: Full Stack web development with Vue 3 and Tailwind CSS, Andrés Cruz Yoris: Real Full Stack Web Development with Vue 3, Tailwind CSS, REST API, Role Management with Spatie, and Testing with Pest Free sample: the foreword, the intended reader, the introduction and the index of the first chapters. 2026. Free sample: PDF
- 12.Full-Stack Laravel 13 and Livewire 4 + IA + Alpine.js: Build real applications from scratch, Andrés Cruz Yoris: Master reactive flow with Livewire 3, Flux, Boost, and Alpine.js by building real full-stack applications from scratch Free sample: the front matter, the chapter map and chapter 1 on what Livewire is. 2026. Free sample: PDF
- 13.Full-Stack Laravel 13 and Inertia 3: Build real applications from scratch with Vue 3, Andrés Cruz Yoris: Here continue your roadmap in the development of web applications in Laravel with Inertia Free sample: the front matter, the chapter map and chapter 1 on what Inertia is. 2026. Free sample: PDF
- 14.PHP for Laravel Developers: The Core You Missed, Olasunkanmi Emmanuel Jesuferanmi: The Core You Missed: PHP for Laravel Developers fills in the gaps between the smart abstractions of Laravel and the fundamental PHP ideas that power them. Free sample: the contents and the opening chapters on how Laravel wraps core PHP. 2025. Free sample: PDF
- 15.Easy E-Commerce Using Laravel and Stripe, W. Jason Gilmore, Eric L. Barnes: Selling Products and Subscriptions Free sample: the introduction, the project and a summary of each chapter. 2015. Free sample: PDF · EPUB
- 16.Laravel Collections Unraveled, Jeff Madsen No sample: from the description and table of contents. 2017.
- 17.Architecture of complex web applications. Second Edition., Adel F: With examples in Laravel(PHP) No sample: from the description and table of contents. 2024.
- 18.Laravel Packages Development, Tinashe Musonza No sample: from the description and table of contents. 2022.
- 19.Laravel Testing 101, Youghourta Benali: Learn how to add tests to your Laravel CRUD application No sample: from the description and table of contents. 2019.
- 20.
- 21.Deploy Laravel on AWS with CloudFormation, Lionel Martin: How to deploy your application for maximum security, scalability and availability No sample: from the description and table of contents. 2017.
- 22.
- 23.Laravel APIs - Building Better, Phenomenal Jay: Best Practices for API development, Performance & Security No sample: from the description and table of contents. 2025.
- 24.Laravel 12 Authentication and Authorization from Scratch, Roberto Stepic: Build and Understand a Complete Login System with Breeze, Sessions, Middleware and Admin Authorization No sample: from the description. 2026.
- 25.Laravel 12 Cookbook, Second Edition, GitforGits | Asian Publishing House: Build, secure, and scale your apps with solutions across authentication, routing, security, media, APIs, queues, scheduling and automation No sample: from the description. 2026.
- 26.PHP AND LLMs, Alfred Nutile: Practical Integrations using Laravel No sample: from the description and table of contents. 2025.
- 27.
Further reading
Other books in the library on the same ground, not cited above.
- Recipes for Decoupling, Matthias Noback Decoupling PHP code from frameworks with static analysis rules, Laravel among the frameworks covered. 2022. Free sample: PDF · EPUB
- DevOps For PHP Developers, David Mjomba: From Server Setup to Deployment. Setting up a PHP server by hand and with Ansible, then deploying with a pipeline and Laravel's task runner. 2020. Free sample: PDF
- Building AI Applications with PHP, Marcello Duarte: A Practical Guide Using PapiAI, Laravel, and Symfony Applications on large language models in PHP, with a customer support agent built in Laravel. 2026.
- Building a Chatbot with Laravel and BotMan, Joe Dixon, Eric L. Barnes Building a chatbot with Laravel and an open-source bot library. 2018.
- Rapid SaaS with Laravel: Launch Your SaaS in Days, Not Months, Vincent Schmalbach: No-BS guide to building SaaS applications with Laravel at lightning speed Building a subscription product quickly on Laravel. 2025.
- Laravel 13 Livewire 4: Create your Online Store Step by Step, Andrés Cruz Yoris: Build a modern and scalable application with a blog, ecommerce, multilingual support, and Stripe or PayPal payment gateways An online store with a blog, filters and payments, built step by step with Livewire. 2026.
- Building a Hybrid Cache System for Statamic, Johnathon Koster A custom response cache for a content management system built on Laravel. 2023.
- Laravel 12 Training Kit: A Practical Guide to Modern Web Development, Agus Kurniawan A lab manual for Laravel 12 with an exercise after each topic. 2025.