Skip to main content
Overview

Overview

Laravel was created by Taylor Otwell in 2011 as a framework that made common web tasks pleasant without hiding PHP. It follows the model-view-controller pattern and ships with a service container, an expressive database layer called Eloquent, a template engine called Blade, and a command-line tool called Artisan.

Design goals

  • Readable code. Method names describe intent, so controllers and models read like plain English.
  • Convention over configuration. Sensible defaults mean a new project can serve pages within minutes.
  • Batteries included. Authentication, queues, mail, caching, and scheduling are first-party features.
  • Testability. Dependency injection and HTTP testing helpers make automated tests practical.
  • Escape hatches. When a convention does not fit, you can replace a binding, write raw SQL, or drop to plain PHP.

The MVC layers

A model represents data and business rules, usually through an Eloquent class. A view renders HTML using Blade. A controller receives the request, asks models or services for data, and returns a response. Laravel adds middleware, form requests, events, and jobs around these layers so cross-cutting work does not leak into controllers.

The ecosystem

Laravel is more than the framework. Official tools cover local development environments, server provisioning, serverless deployment, admin panels, and starter kits. The wider community publishes packages for payments, media, search, permissions, and almost every integration you can imagine. Composer makes installing them a single command.

A first look at the request lifecycle

  1. The web server sends every request to public/index.php.
  2. The framework boots, loads configuration, and creates the application container.
  3. The HTTP kernel sends the request through global middleware.
  4. The router matches a route and runs its middleware.
  5. A controller or closure produces a response.
  6. Middleware unwinds, the response is prepared, and the server returns it.

Understanding this path explains where to place logic. Validation that applies to one endpoint belongs in a form request; rules that apply to every request belong in middleware; rendering belongs in Blade.

use Illuminate\Support\Facades\Route;

Route::get('/greeting', function () {
    return view('greeting', ['name' => 'Maya']);
});

When Laravel is a good fit

Laravel suits content platforms, dashboards, APIs, marketplaces, and internal tools. It is less attractive when you need to share one process across many languages or when the hosting environment cannot run Composer and a modern PHP version. For most PHP projects, the productivity gain is significant.