Version 8 of the PHP web framework Laravel has been released. The new release contains many new features, including the new Jetstream application framework, a skeleton model directory, model factory classes, migration squashing, throughput rate limitation and dynamic blade components. Already announced for version 6, Laravel now follows the semantic versioning principle (semver) for versioning.
Features in detail
Jetstream is a new application framework for Laravel, which from now on can form the starting point for a Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support and SPA authentication (single-page application ) via Laravel Sanctum and optional team management. It is based on Tailwind CSS and offers scaffolding either on the basis of the Livewire framework or the SPA generator Inertia.
The new Laravel 8 skeleton contains an “app / Models” directory. All generator commands assume that models exist in “app / Models”; however, if this directory does not exist, the framework believes that the application is keeping the models in the app / folder.
If an application contains many migration files, they can now be combined into a single SQL file. This file is run first during migrations, followed by any remaining migration files that are not part of the “Squashed” schema file. Squashing existing migrations can reduce the bloating of the migration file and potentially improve performance while running tests.
Laravel 8 also brings revisions to the throughput rate limitation, at the same time supports downward compatibility with the existing throttle middleware and apparently offers much more flexibility. Laravel users already know the PHP library Carbon, which offers control over changes over time. Laravel 8 apparently goes a step further by providing convenient test aids for manipulating the time within tests.
When developers need to dynamically render a blade component at runtime, Laravel now offers the
<x-dynamic-component/> to render this component.
Take a deep dive