1. Type Safety with Native Declarations
Laravel 10 updates the core skeleton and stubs to use PHP native argument and return type declarations. This change improves code readability and consistency while making better use of modern PHP features. Backward compatibility is maintained, so older applications without these type hints remain functional.
2. Feature Flags with Laravel Pennant
A new first-party package, Laravel Pennant, provides a robust system for managing feature flags. Developers can define and manage feature rollouts using simple APIs. Pennant supports both in-memory and persistent drivers, making it ideal for A/B testing or gradual feature rollouts.
3. Process Abstraction Layer
Laravel 10 introduces the Process
facade, allowing developers to interact with system processes seamlessly. It supports concurrent execution with pools, simplified management, and faking for testing scenarios.
4. Customizable Config Paths
Developers can now customize paths for configuration files, offering greater flexibility when integrating Laravel into non-standard directory structures. This feature simplifies migrations for applications adapting Laravel gradually.
5. Native Schema Column Operations
Column modifications in database migrations now leverage native database features, removing the dependency on doctrine/dbal
for most scenarios. This streamlines migration scripts and improves performance.
6. Invokable Validation Rules by Default
Validation rules are now generated as invokable by default, reducing boilerplate code and simplifying custom rule creation.
7. Other Enhancements
A
Str::password()
helper for generating secure passwords.A
--profile
flag in tests to identify slow-running cases.Updated design and improved user interfaces for Telescope and Horizon.
8. Deprecations and Requirements
Dropped support for PHP 8.0; Laravel 10 requires PHP 8.1 or higher.
Composer 2.2 is now a minimum requirement.
Deprecated methods from Laravel 9 have been removed to ensure a cleaner codebase.
Laravel 10 continues the framework's evolution, embracing modern PHP features and simplifying complex workflows, making it an essential upgrade for developers. For more details, check out the Laravel official blog or Laravel News.