0% found this document useful (0 votes)
9 views

nova-laravel-com-docs-v5-installation

The document provides a comprehensive guide on installing and configuring Laravel Nova, including system requirements, browser support, and steps for installation via Composer. It covers essential topics such as registering a license key, customizing the interface, and authorizing access to Nova. Additionally, it includes instructions for using Nova in development and staging environments, as well as customizing various aspects of the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

nova-laravel-com-docs-v5-installation

The document provides a comprehensive guide on installing and configuring Laravel Nova, including system requirements, browser support, and steps for installation via Composer. It covers essential topics such as registering a license key, customizing the interface, and authorizing access to Nova. Additionally, it includes instructions for using Nova in development and staging environments, as well as customizing various aspects of the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

v5 Search or ask...

Ctrl K Support Platform Status Dashboard

Documentation Knowledge Base

Community Get Started On this page


Blog
Installation Requirements
Browser Support
Get Started Learn how to install Laravel Nova into your Laravel application.
Installing Nova via Composer
Installation Registering a Nova License Key and
Release Notes Production URL
Verifying Your Nova License Key
Upgrade Guide Purchase Nova Learn More Configuration
Purchase a license for Laravel Nova Watch the free Nova series on Laracasts
Authenticating Nova in CI Environments
Resources
Using Nova on Development and Staging
The Basics Domains
Fields Requirements Authorizing Access to Nova
Customization
Dependent Fields
Laravel Nova has a few minimum requirements you should be aware of before installing: Branding
Date Fields
Composer 2 Brand Logo
File Fields
Laravel Framework 10.x, 11.x, or 12.x Brand Color
Repeater Fields
Customizing Nova’s Footer
Inertia.js 2.x
Field Panels Customizing Nova’s Authentication
Laravel Mix 6.x Guard
Relationships
Node.js (Version 18.x+) Customizing Nova’s Storage Disk Driver
Validation
NPM 9.x Customizing Nova’s Initial Path
Authorization
Enabling Breadcrumbs
Enabling RTL Support
Search Browser Support Disabling Nova’s Theme Switcher
The Basics Nova supports modern versions of the following browsers: Error Reporting
Global Search Updating Nova
Apple Safari
Scout Integration Updating Nova’s Assets
Google Chrome
Keeping Nova’s Assets Updated
Filters Microsoft Edge Code Distribution
Defining Filters Mozilla Firefox Legal and Compliance
Registering Filters
Installing Nova via Composer
Lenses
You may install Nova as a Composer package via our private Satis repository. To get
Defining Lenses started, add the Nova repository to your application’s composer.json file:
Registering Lenses
composer.json

Actions
"repositories": [
Defining Actions {
"type": "composer",
Registering Actions
"url": "https://nova.laravel.com"
}
Metrics ],

Defining Metrics
Registering Metrics Or, you may use the following CLI command to add the Composer repository to your
composer.json file:
Digging Deeper

Dashboards composer config repositories.nova '{"type": "composer", "url": "https://n

Menus
Notifications Next, you may add laravel/nova to your list of required packages in your
composer.json file:
Authentication
Impersonation
composer.json
Tools
"require": {
"php": "^8.2",
"laravel/framework": "^12.0",
"laravel/nova": "^5.0"
},
Community

Blog
After your composer.json file has been updated, run the composer update
command in your console terminal:
Get Started

Installation composer update --prefer-dist


Release Notes
Upgrade Guide
When running composer update , you will be prompted to provide a username and
password. You should use your Nova website email for the username and a license key
Resources should be used as the password. These credentials will authenticate your Composer
The Basics session as having permission to download the Nova source code.
Fields To avoid manually typing these credentials, you may create a Composer auth.json file
Dependent Fields while using your license key in place of your password:
Date Fields
File Fields composer config http-basic.nova.laravel.com your-nova-account-email@your-

Repeater Fields
Field Panels Finally, run the nova:install and migrate Artisan commands. The nova:install
Relationships command will install Nova’s service provider and public assets within your application:
Validation
php artisan nova:install
Authorization
php artisan migrate
Search

The Basics
The default App\Nova\User Nova resource references the App\Models\User model.
Global Search If you place your models in a different directory or namespace, you should adjust this
Scout Integration value within the resource:

app/Nova/User.php
Filters

Defining Filters namespace App\Nova;


Registering Filters
class User extends Resource
{
Lenses /**
* The model the resource corresponds to.
Defining Lenses *
Registering Lenses * @var class-string<\App\Models\User>
*/
public static $model = \App\Models\User::class;
Actions }
Defining Actions
Registering Actions If your application’s users table is empty or you want to create a new user, you can
run the nova:user Artisan command:
Metrics

Defining Metrics php artisan nova:user

Registering Metrics

That’s it! Next, you may navigate to your application’s /nova path in your browser and
Digging Deeper you should be greeted with the Nova dashboard which includes links to various parts of
Dashboards this documentation.
Menus
Notifications Registering a Nova License Key and Production URL
Authentication
Nova requires a license key and a production URL to be used in production
Impersonation environments. Nova will check your license key and the current host against the values
Tools from the license details found in your Nova account.
You can generate license keys and register the production URL for your project inside
the license’s page on your Nova account at https://nova.laravel.com/licenses:

Community

Blog

Get Started

Installation
Release Notes
Upgrade Guide

Resources

The Basics
Fields
Dependent Fields
Date Fields
File Fields
Repeater Fields
You can register a wildcard subdomain for your production URL for use in multi-tenant
Field Panels scenarios (e.g. *.laravel.com ).
Relationships
Validation You can register your license key by setting the NOVA_LICENSE_KEY variable to .env
file or license_key option in your config/nova.php configuration file:
Authorization

.env config/nova.php
Search

The Basics NOVA_LICENSE_KEY=

Global Search
Scout Integration
Verifying Your Nova License Key Configuration
Filters To verify everything has been configured correctly, you should run the nova:check-
license command:
Defining Filters
Registering Filters
php artisan nova:check-license

Lenses

Defining Lenses
Authenticating Nova in CI Environments
Registering Lenses
It’s not recommended to store your Composer auth.json file inside your project’s
source control repository. However, there may be times you wish to download Nova
Actions
inside a CI environment like CodeShip. For instance, you may wish to run tests for any
Defining Actions custom tools you create.
Registering Actions
To authenticate Nova in these situations, you can use Composer’s config command
to set the configuration option inside your CI system’s pipeline, injecting environment
Metrics variables containing your Nova username and license key:
Defining Metrics
Registering Metrics composer config http-basic.nova.laravel.com "${NOVA_USERNAME}" "${NOVA_LI

Digging Deeper

Dashboards Using Nova on Development and Staging Domains


Menus Since Nova can be used in local and staging development environments, Nova will not
Notifications check your license key when used on localhost or local TLDs like those specified in
IETF RFC 2606:
Authentication
Impersonation .test

Tools .example
.invalid

.localhost

.local

Nova will also not check the current license key when the subdomain is one of these
Community commonly-used staging subdomains:
Blog
staging.

Get Started stage.

test.
Installation
testing.
Release Notes
dev.
Upgrade Guide
development.

Resources

The Basics Authorizing Access to Nova


Fields
Within your app/Providers/NovaServiceProvider.php file, there is a gate method.
Dependent Fields This authorization gate controls access to Nova in non-local environments. By default,
Date Fields any user can access the Nova dashboard when the current application environment is
local . You are free to modify this gate as needed to restrict access to your Nova
File Fields
installation:
Repeater Fields
Field Panels app/Providers/NovaServiceProvider.php

Relationships
use Illuminate\Support\Facades\Gate;
Validation
Authorization // ...

/**
Search * Register the Nova gate.
*
The Basics
* This gate determines who can access Nova in non-local environments.
Global Search */
protected function gate(): void
Scout Integration
{
Gate::define('viewNova', function ($user) {
Filters return in_array($user->email, [
'taylor@laravel.com',
Defining Filters ]);
Registering Filters });
}

Lenses

Defining Lenses
Customization
Registering Lenses
Branding
Actions Although Nova’s interface is intended to be an isolated part of your application that is
Defining Actions
managed by Nova, you can make some small customizations to the branding logo and
color used by Nova to make the interface more cohesive with the rest of your
Registering Actions application.

Metrics

Defining Metrics
Registering Metrics

Digging Deeper

Dashboards
Menus
Notifications
Authentication
Impersonation
Tools
Brand Logo
To customize the logo used at the top left of the Nova interface, you may specify a
configuration value for the brand.logo configuration item within your application’s
config/nova.php configuration file. This configuration value should contain an
absolute path to the SVG file of the logo you would like to use:

Community config/nova.php

Blog
'brand' => [
'logo' => resource_path('/img/example-logo.svg'),
Get Started
// ...
Installation
],
Release Notes
Upgrade Guide
You may need to adjust the size and width of your SVG logo by modifying its width in the
SVG file itself.
Resources

The Basics
Fields Brand Color
Dependent Fields To customize the color used as the “primary” color within the Nova interface, you may
specify a value for the brand.colors configuration item within your application’s
Date Fields
config/nova.php configuration file. This color will be used as the primary button color
File Fields as well as the color of various emphasized items throughout the Nova interface. This
Repeater Fields configuration value should be a valid RGB, RGBA, or HSL string value:
Field Panels
config/nova.php
Relationships
Validation 'brand' => [
// ...
Authorization
'colors' => [
Search "400" => "24, 182, 155, 0.5",
"500" => "24, 182, 155",
The Basics "600" => "24, 182, 155, 0.75",
]
Global Search
],
Scout Integration

Filters
Customizing Nova’s Footer
Defining Filters
There are times you may wish to customize Nova’s default footer text to include
Registering Filters relevant information for your users, such as your application version, IP addresses, or
other information. Using the Nova::footer method, you may customize the footer
Lenses text of your Nova installation. Typically, the footer method should be called within
the boot method of your application’s App\Providers\NovaServiceProvider class:
Defining Lenses
Registering Lenses app/Providers/NovaServiceProvider.php

Actions use Illuminate\Http\Request;


use Illuminate\Support\Facades\Blade;
Defining Actions use Laravel\Nova\Nova;
Registering Actions
// ...

Metrics /**
* Boot any application services.
Defining Metrics
*/
Registering Metrics public function boot(): void
{
parent::boot();
Digging Deeper

Dashboards Nova::footer(function (Request $request) {


return Blade::render('
Menus @env(\'prod\')
Notifications This is production!
@endenv
Authentication ');
Impersonation });
}
Tools
Customizing Nova’s Authentication Guard
Nova uses the default authentication guard defined in your auth configuration file. If
you would like to customize this guard, you may set the NOVA_GUARD value using
.env file or guard value within Nova’s configuration file:

Community
.env config/nova.php
Blog
NOVA_GUARD=(null)
Get Started

Installation
Release Notes
Customizing Nova’s Storage Disk Driver
Upgrade Guide Nova uses the default storage disk driver defined in your filesystems configuration
file. If you would like to customize this disk, you may set the NOVA_STORAGE_DISK value
using .env file the storage_disk value within Nova’s configuration file:
Resources

The Basics .env config/nova.php

Fields
NOVA_STORAGE_DISK=public
Dependent Fields
Date Fields
File Fields Customizing Nova’s Initial Path
Repeater Fields
When visiting Nova, the Main dashboard is typically loaded by default. However, you
Field Panels are free to define a different initial path that should be loaded using Nova’s
Relationships initialPath method. Typically, this method may be invoked from the register
method of your application’s App\Providers\NovaServiceProvider service provider:
Validation
Authorization app/Providers/NovaServiceProvider.php

Search /**
* Register any application services.
The Basics */
Global Search public function register(): void
{
Scout Integration parent::register();

Filters Nova::initialPath('/resources/users');

Defining Filters // ...


}
Registering Filters

Lenses In addition to a string path, the initialPath method also accepts a closure that
Defining Lenses returns the path that should be loaded. This allows you to dynamically determine the
initial path based on the incoming request:
Registering Lenses

app/Providers/NovaServiceProvider.php
Actions

Defining Actions /**


* Register any application services.
Registering Actions */
public function register(): void
{
Metrics
parent::register();
Defining Metrics
Nova::initialPath(function ($request) {
Registering Metrics
return $request->user()->initialPath();
});
Digging Deeper
// ...
Dashboards }
Menus
Notifications
Authentication Enabling Breadcrumbs
Impersonation If you would like Nova to display a “breadcrumb” menu as you navigate your Nova
dashboard, you may invoke the Nova::withBreadcrumbs method. This method should
Tools
be invoked from within the boot method of your application’s
App\Providers\NovaServiceProvider class:

app/Providers/NovaServiceProvider.php

Community /**
* Boot any application services.
Blog */
public function boot(): void
Get Started {
parent::boot();
Installation
Release Notes Nova::withBreadcrumbs();
}
Upgrade Guide

Resources The withBreadcrumbs method also accepts a closure that allows you to enable
breadcrumbs for specific users or other custom scenarios:
The Basics
Fields app/Providers/NovaServiceProvider.php
Dependent Fields
use Laravel\Nova\Http\Requests\NovaRequest;
Date Fields
use Laravel\Nova\Nova;
File Fields
// ...
Repeater Fields
Field Panels Nova::withBreadcrumbs(function (NovaRequest $request) {
return $request->user()->wantsBreadcrumbs();
Relationships
});
Validation
Authorization
Enabling RTL Support
Search
If you wish to display Nova’s content “right-to-left” (RTL), you can enable this behavior
The Basics by calling the enableRTL method from your App\Providers\NovaServiceProvider
Global Search service provider:
Scout Integration
app/Providers/NovaServiceProvider.php

Filters /**
* Boot any application services.
Defining Filters
*/
Registering Filters public function boot(): void
{
parent::boot();
Lenses

Defining Lenses Nova::enableRTL();


}
Registering Lenses

Actions The enableRTL method also accept a closure that allows you to enable RTL support
for specific users or in other custom scenarios:
Defining Actions
Registering Actions
use Illuminate\Http\Request;
use Laravel\Nova\Nova;
Metrics
// ...
Defining Metrics
Registering Metrics Nova::enableRTL(fn (Request $request) => $request->user()->wantsRTL());

Digging Deeper

Dashboards Disabling Nova’s Theme Switcher


Menus If you wish to completely hide Nova’s light/dark mode switcher and instead have Nova
honor the system preference only, you can call the withoutThemeSwitcher method
Notifications
from your App/Providers/NovaServiceProvider :
Authentication
Impersonation app/Providers/NovaServiceProvider.php

Tools
/**
* Boot any application services.
*/
public function boot(): void
{
Community parent::boot();

Blog Nova::withoutThemeSwitcher();
}
Get Started

Installation
Release Notes Error Reporting
Upgrade Guide Nova uses its own internal exception handler instead of using the default
App\Exceptions\ExceptionHandler . If you need to integrate third-party error
Resources reporting tools with your Nova installation, you should use the Nova::report method.
Typically, this method should be invoked from the register method of your
The Basics
application’s App\Providers\NovaServiceProvider class:
Fields
Dependent Fields app/Providers/NovaServiceProvider.php

Date Fields
/**
File Fields * Register any application services.
*/
Repeater Fields
public function register(): void
Field Panels {
parent::register();
Relationships
Validation Nova::report(function ($exception) {
if (app()->bound('sentry')) {
Authorization
app('sentry')->captureException($exception);
}
Search });
}
The Basics
Global Search
Scout Integration
Updating Nova
Filters To update your Nova installation, you may run the composer update command:

Defining Filters
composer update
Registering Filters

Lenses
Updating Nova’s Assets
Defining Lenses
After updating to a new Nova release, you should be sure to update Nova’s JavaScript
Registering Lenses and CSS assets using the nova:publish Artisan command and clear any cached
views using the view:clear Artisan command. This will ensure the newly-updated
Actions Nova version is using the latest versions of Nova’s assets and views:
Defining Actions
php artisan nova:publish
Registering Actions
php artisan view:clear

Metrics

Defining Metrics The nova:publish command will re-publish Nova’s public assets, configuration, views,
and language files. This command will not overwrite any existing configuration, views, or
Registering Metrics
language files. If you would like the command to overwrite existing files, you may use
the --force flag when executing the command:
Digging Deeper

Dashboards php artisan nova:publish --force


Menus
Notifications
Authentication Keeping Nova’s Assets Updated
Impersonation To ensure Nova’s assets are updated when a new version is downloaded, you may add a
Composer hook inside your project’s composer.json file to automatically publish
Tools
Nova’s latest assets:
composer.json

"scripts": {
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
Community "@php artisan nova:publish --ansi"
]
Blog }

Get Started

Installation Code Distribution


Release Notes
Nova’s license does not allow the public distribution of its source code. So, you may not
Upgrade Guide build an application using Nova and distribute that application public via open source
repository hosting platforms or any other code distribution platform.
Resources
If you would like to develop a third party package that augments Nova’s functionality,
The Basics you are free to do so. However, you may not distribute the Nova source code along with
Fields your package.
Dependent Fields
Date Fields Legal and Compliance
File Fields
Our Terms of Service and Privacy Policy provide details on the terms, conditions, and
Repeater Fields privacy practices for using Laravel Nova.
Field Panels
Relationships
Was this page helpful? Yes No
Validation
Authorization

Search Release Notes

The Basics
Global Search
Scout Integration

Filters Platform Legal and Compliance


Defining Filters Dashboard Term of Service
Registering Filters Status Privacy Policy

Lenses

Defining Lenses
Registering Lenses

Actions

Defining Actions
Registering Actions

Metrics

Defining Metrics
Registering Metrics

Digging Deeper

Dashboards
Menus
Notifications
Authentication
Impersonation
Tools

You might also like