Learn how to upgrade your Laravel Nova installation to the latest version.
doctrine/dbal
from ^2.9
to ^2.13.3|^3.1.2|^4.0
laravel/ui
from ^2.0|^3.0
to ^3.3|^4.0
symfony/*
from ^5.0
to ^5.4|^6.0|^7.0
cakephp/chronos
and moontoast/math
dependenciesv1
to v6
flatpickr
and moment.js
laravel/nova
dependency to ^4.0
in your application’s composer.json
file:
middleware
and api_middleware
configuration options within your application’s nova
configuration file appear as follows:
nova
configuration file contains a storage_disk
configuration option:
Laravel\Nova\Http\Requests\NovaRequest
instance instead of an Illuminate\Http\Request
instance. An overview of the methods that have been updated is provided below so you may update your method signatures accordingly.
fields
, fieldsForIndex
, fieldsForDetail
, fieldsForCreate
, fieldsForUpdate
, cards
, filters
, lenses
, and actions
methods:
fields
, filters
, and actions
methods:
fields
method:
apply
and options
methods:
cards
method of your application’s NovaServiceProvider
. However, in Nova 4, a dedicated Main
dashboard class must be created via the following command:
cards
method from your NovaServiceProvider
to the cards
method of your new App\Nova\Dashboards\Main
class and register the Main
dashboard within the dashboards
method of your NovaServiceProvider
:
label
and uriKey
methods defined on dashboard classes are no longer static. You should update your methods accordingly:
app
configuration file.
Please refer to our documentation regarding timezone customization for more information.
Date
/ DateTime
Fields & HTML5<input type="date" />
and <input type="datetime-local" />
elements to render the Date
and DateTime
fields. Therefore, the following methods have been removed from Nova 4:
firstDayOfWeek()
format()
pickerFormat()
pickerDisplayFormat()
incrementPickerHourBy()
incrementPickerMinuteBy()
Place
field has been deprecated and we encourage you to migrate to Text
fields for street addresses and cities.
src/Console/tool-stubs
directory to your own custom package:
nova.mix.js
package.json
webpack.mix.js
:::webpack.mix.js
:
laravel-nova
NPM Dependencysrc/Console/stubs
especially the following files:nova.mix.js
packages.json
webpack.mix.js
laravel-nova
NPM package. In 4.0, this is no longer the case as each mixin has been integrated into Nova itself. To upgrade any custom packages you’ve created, you must update your webpack.mix.js
file to define an alias to vendor/laravel/nova/resources/js/mixins/packages.js
:
Typically, custom Nova tools, resource tools, cards, and other custom packages that are being developed within a nova-components
directory of a Laravel application can reference Nova’s own packages.js
file by defining a laravel-nova
alias that points to the file within the Nova installation that is located within your root application’s vendor
directory. This alias is typically defined within the custom package’s nova.mix.js
file:
nova-components
directory should declare laravel/nova
as a “dev” Composer dependency, and then define a laravel-nova
Mix alias that points to the packages.js
file within your custom package’s vendor
directory:
laravel-nova
mixins you are required to prepare laravel/nova
’s node_modules
by running the following command:
User
resource to the database, even though the event listener returns false
:
Laravel\Nova\Exceptions\ResourceSaveCancelledException
exception in Nova 4.
Field::default
Method Only Applies to Create, Attach, & Action Requests$attributes
property:
purchased_books
; however, Nova 4 will correctly assume the relationship method is named purchasedBooks
.
Action::actionClass
Method RemovedactionClass
method.
eloquent
in order to resolve information regarding the currently authenticated user.
In your application’s default config/auth.php
configuration file, the Eloquent user provider is specified and it is instructed to use the App\Models\User
model when retrieving users. You may change these values within your configuration file based on the needs of your application.
Action::showOnTableRow
MethodAction::showOnTableRow
method has been deprecated. Instead, we suggest updating your code to use the showInline
method:
view
a resource no longer depends on the viewAny
permission.view
and viewAny
permissions.canRun
method before falling back to the model’s policy.nova:stubs
Artisan command with the --force
option: