Laravel Nova is a powerful administration panel for Laravel applications, designed to simplify the process of building custom administration panels. Here's a step-by-step guide to help you get started with Laravel Nova:
1. Make sure you have a Laravel project set up.
2. Visit the Laravel Nova website and purchase a license.
3. After purchasing, you'll receive a download link. Download Nova and follow the installation instructions provided in the documentation.
1. Once installed, register Nova as a service provider in your config/app.php
file:
php'providers' => [
// ...
Nova\NovaCoreServiceProvider::class,
],
2. Publish the Nova assets and configuration file:
bashphp artisan nova:install
3. Configure your Nova installation by editing the config/nova.php
file. You can customize settings such as the path, resources, and authentication guard.
1. Nova uses "resources" to represent data models in the administration panel. To create a resource, use the following command:
bashphp artisan nova:resource YourModel
This will generate a resource file in the Nova
directory. Customize the fields and actions in this file to define how your model is presented in the Nova panel.
Register your Nova resources in the NovaServiceProvider
located at app/Providers/NovaServiceProvider.php
. Add the resources to the register
method:
phpprotected function resources()
{
Nova::resources([
\App\Nova\YourModel::class,
]);
}
1. Nova provides various tools for customization. Explore the NovaServiceProvider
for additional configuration options.
2. You can customize the Nova dashboard by modifying the resources/views/vendor/nova/dashboard.blade.php
file.
nova
guard. Ensure that your users are authenticated using this guard. You can modify the config/nova.php
file for authentication configuration.Remember to check for the latest documentation and resources, as they may be updated after my knowledge cutoff date in January 2022.
=== Happy Coding :)