Framework12 min readNot archived on GitHub

Laravel: a full-stack MVC framework for PHP

A guide to Laravel as a PHP application framework: what it is, how it is structured, how to install it, and what the supplied source does not say.

PHP compatibility and project lifecycle

Unknown from the supplied packet: the PHP versions supported by the documented Laravel 13.x are not stated. The php.new scripts reference PHP 8.5, and the PHP 8.1 minimum applies only to Laravel Boost. The learning track stays on PHP 8.4, so verify the requirements on the official site first.

Official sources checked 2026-10-22. Browser lessons on this site run PHP 8.5.

It relies only on the supplied Laravel installation documentation packet, which is headed Laravel 13.x. Where that packet is silent, this guide says unknown.

What Laravel is

The documentation describes Laravel as a web application framework with expressive syntax. It supplies structure and a starting point so you can concentrate on your application. Features named in the packet include dependency injection, a database abstraction layer, queues and scheduled jobs, and unit and integration testing. The learning focus here is a full-stack MVC framework.

What Laravel is not

Laravel is a framework written in PHP. It is not PHP core, and it is not a standalone PHP runtime. Your code runs on a PHP engine that you install separately. It is also not a CMS product. Drupal CMS, for example, is a content management product built on its own components. A framework gives you building blocks for your own application, while a CMS ships content modelling and administration as the product. The packet does not discuss Drupal, so this contrast is general background only. Laravel's own pieces, such as routing, Eloquent ORM and queues, are framework features you assemble into an application. They are not a ready-made content system.

Architecture

The documentation table of contents names the main architectural concepts:

  • Request lifecycle
  • Service container
  • Service providers
  • Facades
  • Routing, middleware, controllers, requests and responses
  • Views and Blade templates
  • Validation, sessions, and error handling and logging
  • Artisan console, queues, events and task scheduling
  • Eloquent ORM and the query builder with migrations
  • Authentication and authorization

The packet lists these topics but does not explain their internals, so consult the linked pages for detail. All framework configuration lives in the config directory. Environment-specific values come from a .env file at the application root.

Execution model

In a classic PHP request lifetime, the web server hands each request to PHP, the application boots, builds a response, and the process state is discarded. Leaked state is rarely a problem there because everything is rebuilt per request.

Persistent workers keep the booted application in memory across many requests. The packet lists Octane among Laravel's packages but contains no Octane details, so its behavior, supported servers and requirements are unknown here. Swoole and Open Swoole are separate projects. Do not treat the names as interchangeable, and check each project's own documentation. This guide's source does not cover either one.

In any persistent-worker model, state leakage is the central risk. These are general concerns, not claims from the packet:

  • Static properties and singletons can carry one user's data into the next request.
  • Caches held in memory can go stale.
  • Request-specific values stored in long-lived objects can be read by the wrong request.
  • Open connections and file handles can outlive their useful life.

Cleanup means resetting or avoiding that state between requests. Keep request data in request-scoped objects and avoid mutable statics. Release resources explicitly, and test with repeated requests from different users. Do not assume a persistent worker is safe for existing code without that review.

Practical use cases

The packet positions Laravel for full-stack web applications and as an API backend. It names starter kits that provide backend and frontend authentication scaffolding. Queues, scheduled jobs, broadcasting, mail and notifications appear in the documentation index, which suggests background and real-time work fits the framework. The packet makes scaling claims, including Redis-backed caching and Laravel Cloud. This guide does not verify them and gives no performance numbers.

Installation approach

The documented path needs PHP, Composer and the Laravel installer. You also need Node with NPM, or Bun, to compile frontend assets. The packet offers php.new scripts for macOS, Windows and Linux that reference PHP 8.5. If PHP and Composer already exist, the installer is added through Composer. Laravel Herd is a native development environment for macOS and Windows that bundles PHP and Nginx and a Laravel CLI.

After running the laravel new command, you build assets and start the documented dev Composer script. That script starts the local development server, a queue worker and the Vite development server. The packet says the application is then reachable at localhost on port 8000. By default the new application uses SQLite, and the installer creates the database file and runs migrations. For MySQL or PostgreSQL, change the DB settings in .env, create the database, and run the migrate Artisan command.

The example below follows this workflow. The installer generates the project skeleton, including composer.json, the artisan entry point and the public web root. This guide does not reproduce those files, because their contents are version-specific and not in the packet.

Strengths

  • Conventional structure, which the source says helps both newcomers and AI-assisted tooling.
  • A broad first-party feature set: queues, testing, authentication, ORM and more.
  • Documented local setup, with SQLite by default and optional Herd.
  • Official starter kits and editor support through the Laravel LSP.

Limitations and unknowns

  • The PHP versions supported by Laravel 13.x are not stated in the packet, so this guide does not claim PHP 8.4 compatibility. The only stated minimum, PHP 8.1, applies to the optional Boost tool.
  • The release, support and end-of-life status is not in the packet, so lifecycle is unknown.
  • The packet gives no licensing or pricing detail. It mentions paid Herd Pro and Laravel Cloud without prices.
  • Persistent-worker support through Octane is not documented in the packet.
  • The framework brings many conventions and dependencies, so small scripts may not need it.

Deployment notes

The documentation says to serve Laravel from the root of the configured web directory, never from a subdirectory, because a subdirectory could expose sensitive files. Keep .env out of source control, since it can hold credentials. If you place PHP-FPM behind a web server, bind FastCGI to a private interface or socket and never expose it publicly. For any development server, keep the port on 127.0.0.1 unless you have a deliberate reason otherwise. The packet points to a Deployment page and to Laravel Cloud, but their content is not included, so production specifics are unknown here.

Next steps

The example is a runtime-style exercise, not a browser exercise. It needs Composer, Node and network access. Read the official Request Lifecycle, Routing and Deployment pages next.

Practical examples

These examples have not been run in a live environment yet. Commands and versions follow the official documentation linked on this page; check them before relying on them, and report a problem if one does not work.

Create a Laravel app with the installer and add one route

Uses the documented Composer, installer and dev-script workflow to create example-app, then replaces the generated routes/web.php with one small route. The installer generates composer.json, artisan, the public web root and config, and they are not reproduced here. The generated routes/web.php may differ by version; this file replaces it, so keep a copy if you want the default welcome route. Requires PHP, Composer, Node with NPM and network access; this is not a browser exercise. Compatibility with PHP 8.4 for the installed Laravel version is unverified and must be confirmed against the official requirements.

example-app/routes/web.php

<?php

use Illuminate\Support\Facades\Route;

Route::get('/hello', function () {
    return 'Hello from Laravel on PHP ' . PHP_VERSION;
});

Install and run

composer global require laravel/installer
laravel new example-app
cd example-app
npm install && npm run build
composer run dev

Expected behavior

After the installer finishes and composer run dev starts the development processes, the documentation says the app is reachable at http://localhost:8000. Once routes/web.php is replaced with the file above, visiting /hello should return a plain text line naming the PHP version in use.

Requires Composer, Node and network access, and ensure the Composer global bin directory is on your PATH. Skeleton contents and PHP requirements vary by Laravel version and are not in the packet. The dev script's bind address is not documented in the packet, so do not expose the port beyond your machine. Not a production deployment, and not a persistent-worker setup.