What Is New in Laravel 10.0
| Category | Key Changes |
|---|---|
| New Features | Laravel Pennant, Process Interaction, Native Type Declarations, New laravel commands
|
| Improvements | Pest Scaffolding, Generator CLI Prompts, Horizon & Telescope Improvements, New String Helpers |
| Deprecated | Removed Deprecated Code from Framework Core and First-Party Packages |
What new packages were introduced?
Laravel 10 ships with a brand new first-party package called Laravel Pennant. This package provides a streamlined solution for managing feature flags in your application.
Feature flags let you roll out new application features with confidence, enabling them for specific users or environments. Pennant's simple API and array-based driver make it incredibly easy to get started without needing an external service.
How does the new Process interaction work?
A new abstraction for interacting with external processes is a major addition. The Process facade
allows you to easily invoke and manage command-line processes from your Laravel application.
This is a game-changer for running artisan commands, system tools, or any shell script. It handles testing fakes, output retrieval, and process lifecycle management, making what was previously complex much simpler.
$result = Process::run('ls -la');
What about type safety in the codebase?
Laravel 10 pushes the framework towards modern PHP by incorporating native type declarations into all skeleton code generated by the framework's make commands.
This means new models, controllers, listeners, and other classes you generate will include return types and type hints for method arguments. It encourages a more robust and self-documenting code style across your entire project.
Are there new developer experience improvements?
Absolutely. The Artisan command-line interface got smarter with new interactive prompts for the
make: commands. If you forget to pass a required argument, Artisan will now prompt you for it
instead of throwing an error.
Pest test scaffolding is now included out of the box. When creating a new Laravel project, you can use the
--pest flag to generate Pest tests instead of PHPUnit. Horizon and Telescope also received various
usability enhancements.
What was removed or deprecated?
This release continues the annual tradition of removing deprecated code. All previously deprecated functionality from the framework core and first-party packages has been stripped out.
In practice, this cleanup keeps the framework lean and modern. If you're upgrading from an older version, you'll need to ensure your application isn't relying on any methods or features that were marked for removal in Laravel 9.
FAQ
Is the new Process facade a replacement for running shell_exec?
Yes, it's a much safer and
more powerful abstraction. It handles escaping arguments, capturing output, and provides a testable interface
that you can fake during testing.
Do I have to use Pest instead of PHPUnit now?
No, it's optional. PHPUnit remains the default.
The new --pest flag just gives you a choice when starting a new project.
What happens if my app uses a deprecated method that was removed?
The application will break
with a fatal error. You must audit your codebase for any calls to methods deprecated in Laravel 9 before
upgrading.
Are the new type declarations in skeleton code strict?
They use PHP's union types and mixed
types where appropriate, providing a good balance of type safety and flexibility for a framework context.
Is Pennant a replacement for third-party feature flag services?
For many use cases, yes. It's
perfect for flags driven by your application's database. For extremely high-scale or complex scenarios, you
might still opt for a dedicated service.