What is Laravel? The PHP framework explained
What is Laravel? A plain explanation of the PHP framework: what comes with it, how an app works, what it is used for and what Laravel development means.
What is Laravel? The short answer: Laravel is a free, open-source framework for building web applications in PHP. This post explains what that means in practice, what comes with it, how a Laravel app works, what it is used for, and when it is the wrong tool. I am a developer in Vejle who builds and takes over business systems, so read it with that in mind.
What is Laravel?#
Laravel is a web framework written in PHP, created by Taylor Otwell and first released in 2011. It is open source under the MIT licence, so it costs nothing to use and the code is public.
A framework is the ready-made foundation an application is built on: how a request from the browser reaches the right code, how data is read from and written to the database, how pages are rendered and how users log in. Without one, every project builds those parts again from scratch. With Laravel, the hours go into the parts that are specific to your business.
Laravel follows the model-view-controller (MVC) pattern. Models represent the data, views render what the user sees, and controllers sit in between and decide what happens on each request. Under the hood it builds on a number of well-tested Symfony components, and it is installed and kept up to date with Composer, the package manager for PHP.
What comes with Laravel?#
Most of what a business system needs is built in:
Routing and middleware: which URL runs which code, and the checks that run before it, such as whether the user is logged in and allowed to see the page.
Eloquent: Laravel's ORM. Each database table is a PHP class, so an everyday query like
Order::where('status', 'paid')->get()replaces hand-written SQL.Migrations: changes to the database schema written as code, so every copy of the system, on the developer's machine, on staging and in production, has the same tables.
Blade: the templating language for the HTML pages.
Artisan: the command-line tool, used to run migrations, generate code, clear caches and run the application's own commands.
Queues and scheduling: background jobs, such as sending email, generating PDFs or talking to other systems, and tasks that run on a timetable, like a nightly invoice run.
Authentication, validation, email and notifications, plus built-in support for automated tests with PHPUnit or Pest.
Around the framework there is an ecosystem of packages and services built for it: Livewire and Inertia for interactive interfaces, Horizon for keeping an eye on queues, and Forge and Laravel Cloud for servers and hosting. None of them are required.
How does a Laravel app work?#
A short walk through a single request:
A logged-in customer opens /orders/42. The router finds the route for that address.
Middleware checks that the customer is logged in.
The controller loads order 42 through Eloquent and checks that this customer may see it.
A Blade view renders the page, and the response goes back to the browser.
If the order needs a confirmation email, the controller puts a job on the queue, and a queue worker sends it in the background, so the page does not wait for the mail server.
That is also why a Laravel app is more than its web pages. The scheduled commands and the queue workers have to be running on the server, or parts of the system quietly stop working while the pages look fine.
What is Laravel used for?#
Laravel is used for web applications where the important part is logic rather than content: customer portals, booking and order systems, invoicing, internal tools that have outgrown a spreadsheet, and the API behind a mobile app or a React or Vue front end. A large share of Danish business systems run on it.
It is a poorer fit for a site that is mostly content you want to edit yourselves. There, WordPress is usually cheaper to build and cheaper to run.
Laravel versions and support#
Laravel releases a new major version roughly once a year. Each version gets bug fixes for 18 months and security fixes for two years, and each one needs a minimum PHP version, which has its own support period. An app that is never upgraded therefore slides out of support while it keeps running fine, and the jump gets bigger the longer it waits.
Laravel development#
Laravel development is the work of building and looking after systems on Laravel: new features, upgrades of Laravel and PHP, integrations with accounting, payment and CRM systems, and taking over an app whose developer has moved on. For most businesses the question is not whether to choose Laravel, but who will build further on the Laravel system they already have.
I have written a separate guide on Laravel development and when Laravel is the right choice, and one on the first week of taking over a Laravel app after the developer left.
Frequently asked questions#
Is Laravel a programming language? No. PHP is the programming language, and Laravel is a framework written in PHP. All Laravel code is PHP, but not all PHP code is Laravel.
Is Laravel free? Yes. The framework is open source under the MIT licence. What costs money is hosting, the developer's time and any paid services you choose to add.
Is Laravel frontend or backend? Mainly backend: it runs on the server. It can render the pages itself with Blade, or be the API behind a front end built in React or Vue.
Is Laravel still used? Yes. It is one of the most widely used PHP frameworks, and it gets a new major version every year.
What is the difference between Laravel and WordPress? WordPress is a content management system: you install it and start editing pages. Laravel is a framework: there is nothing to edit until a developer has built the application. Mostly content points to WordPress; mostly logic, users and processes point to Laravel.
If you have a Laravel system that needs building on, upgrading or taking over, you can read more about my Laravel development.
Was this useful?
More notes
Laravel development: when is Laravel the right choice?
What Laravel is, what Laravel development means for a Danish business, when it is the right choice, and what to look for in a Laravel developer.
Shopify in Danish: running your shop in Danish
Shopify can run in Danish all the way. How to set up language, kroner and VAT, MobilePay, shipping and accounting, and what Danish shops often miss.