Laravel Documentation

website·Indexed 30 days ago

https://laravel.chanhyung.kim

Comprehensive documentation for the Laravel PHP framework, covering versions 9.x, 11.x, 12.x, 13.x, and master. Includes guides on Eloquent ORM, Blade templating, routing, database migrations, queue management, and official tools like Laravel Telescope, Dusk, Passport, and Reverb, as well as the AI SDK.

Tokens
1.6M
Snippets
10.8K
Records
11.9K
Agent score
43%

What's inside Laravel

  1. Introduction to Laravel Collections

    The Illuminate\Support\Collection class provides a flexible and convenient wrapper for working with arrays. It allows for fluent mapping and reducing of arrays by chaining methods. Collections are generally immutable; most methods return a new Collection instance rather than modifying the original.
    $collection = collect(['Taylor', 'Abigail', null])->map(function (?string $name) {
        return strtoupper($name);
    })->reject(function (string $name) {
        return empty($name);
    });
  2. Overview of Laravel Precognition

    Laravel Precognition allows developers to provide "real-time" validation in frontend JavaScript applications by predicting the results of future HTTP requests. When a "precognitive request" is received, Laravel executes all route middleware, resolves controller dependencies, and performs Form Request validation, but it does not actually execute the controller method. This prevents the need to duplicate validation logic on the frontend.
  3. Overview of Laravel Logging System

    Laravel provides a powerful logging service based on the Monolog library. It uses 'channels' to define how and where log messages are recorded. A single log message can be sent to multiple channels simultaneously depending on its severity level.
  4. Overview of Laravel Homestead 8.x

    Laravel Homestead is an officially provided, pre-configured Vagrant box that allows developers to set up a professional PHP development environment without manually installing web servers and other server-related software. It runs on Windows, macOS, and Linux and includes Nginx, PHP (multiple versions), MySQL 8.0, PostgreSQL 13, Redis, Memcached, Node, and other essential tools.
  5. Overview of Laravel Sail

    Laravel Sail is a lightweight command-line interface (CLI) for interacting with Laravel's default Docker development environment. It allows developers to build Laravel applications using PHP, MySQL, and Redis without needing deep Docker expertise. It relies on a docker-compose.yml file and a sail script located in the project root. Sail is supported on macOS, Linux, and Windows (via WSL2).
  6. Overview of Laravel Fortify

    Laravel Fortify is a frontend-agnostic authentication backend for Laravel. It registers the routes and controllers necessary for common authentication tasks such as login, registration, password resets, and email verification. Because it is 'headless', it does not provide a user interface; developers must create their own UI and send requests to the routes registered by Fortify. It is an alternative to manually implementing authentication using Laravel's core authentication, password reset, and verification systems.
  7. Overview of Laravel Sail

    Laravel Sail is a lightweight command-line interface (CLI) for interacting with Laravel's default Docker development environment. It allows developers to start Laravel applications with PHP, MySQL, and Redis without requiring deep Docker knowledge. It relies on a docker-compose.yml file and a sail script located in the project root. Sail is supported on macOS, Linux, and Windows (via WSL2).
  8. Overview of Laravel Sanctum Authentication Methods

    Laravel Sanctum provides two distinct authentication mechanisms:

    1. API Tokens: A simple system for issuing 'Personal Access Tokens' (similar to GitHub). Tokens are stored in a database and passed via the Authorization: Bearer header. Ideal for mobile apps or third-party API access.
    2. SPA Authentication: A cookie-based session authentication system for Single Page Applications (SPAs). It leverages Laravel's built-in web guard, providing CSRF protection and preventing XSS exposure of credentials. It does not use tokens for the SPA itself.
  9. Overview of Laravel Database Seeding

    Laravel uses seeder classes to populate databases with test or default data. All seeder classes are stored in the database/seeders directory. The DatabaseSeeder class serves as the main entry point and can be used to control the execution order of other seeders via the call method. Note that mass assignment protection is automatically disabled during database seeding.
  10. Overview of Laravel Homestead

    Laravel Homestead is an officially provided, pre-configured Vagrant box that allows developers to create a consistent PHP development environment without installing server software directly on their local machine. It is compatible with Windows, macOS, and Linux and includes a suite of software such as Nginx, PHP (multiple versions), MySQL 8.0, PostgreSQL 15, Redis, Memcached, Docker, and Node.js.
  11. Introduction to Laravel Blade Templating

    Blade is a powerful templating engine bundled with Laravel. Unlike some PHP engines, it allows the use of plain PHP code within templates. All Blade templates are compiled into plain PHP code and cached until modified, ensuring no performance overhead. Blade templates use the .blade.php file extension and are typically stored in the resources/views directory. They are returned from routes or controllers using the global view helper.
    Route::get('/', function () {
        return view('greeting', ['name' => 'Finn']);
    });
  12. Overview of Laravel Fortify

    Laravel Fortify is a frontend-agnostic authentication backend implementation for Laravel. It registers the necessary routes and controllers for common authentication tasks such as login, registration, password resets, and email verification. Unlike starter kits, Fortify does not provide a user interface; it is designed to be integrated with your own custom UI by sending requests to its registered routes. It is an optional package; developers can alternatively implement authentication manually using Laravel's core authentication, password reset, and email verification documentation.