Laravel Nova 5.0 Now Available

Dec, 17 2024#nova #releases

Laravel Nova 5.0 is now ready for upgrade. This release focuses on modernizing Nova's core dependencies while introducing several useful features to improve resource management and field handling.

Nova 5.0 modernizes dependencies (Inertia 2, PHP 8.1+, Laravel 10+), adds tab panels for better resource organization, and introduces improved field handling. Follow this guide to upgrade.

Modernized Dependencies

Nova 5.0 updates its foundation by requiring PHP 8.1+ and dropping support for Laravel 8.x and 9.x. This allows Nova to take advantage of newer updates and features in the Laravel ecosystem such as:

Tab Panels for Better Resource Organization

Nova 5.0 introduces Tab Panels, providing a cleaner way to organize fields and relationships on resource detail and form pages:

use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\HasManyThrough;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Tabs\Tab;

// ...

/**
 * Get the fields displayed by the resource.
 *
 * @return array<int, \Laravel\Nova\Fields\Field|\Laravel\Nova\Panel>
 */
public function fields(NovaRequest $request): array
{
    return [
        // ...

        Tab::group('Details', [
            Tab::make('Purchases', [ /* List of fields */ ]),
            Tab::make('Registrations', [ /* List of fields */ ]),
            Tab::make('Event & Venue', [ /* List of fields */ ]),
        ]),

        Tab::group(attribute: 'Relations', fields: [
            HasMany::make('Orders', 'orders', Order::class),
            HasManyThrough::make('Tickets', 'tickets', Ticket::class),
        ]),
    ];
}

For example, the code snippet above will generate the following tabs:

image

Improved Field & Resource Handling

Getting Started

Ready to upgrade? Nova 5.0 requires PHP 8.1+ and Laravel 10.x. Check out our upgrade guide for detailed instructions on upgrading to Nova 5.0.

If you purchased Nova within the past year, you can upgrade free of charge. Otherwise you can renew your license to receive the update.

By Cynthia Bell McGills

Marketing @ Laravel

Follow the RSS Feed.