vmitchell85 / nova-links
Add custom links to your nova navigation
Installs: 132 748
Dependents: 0
Suggesters: 0
Security: 0
Stars: 21
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
- laravel/nova: *
Requires (Dev)
- orchestra/testbench: ^3.6
- phpunit/phpunit: 7.1
This package is auto-updated.
Last update: 2021-01-15 06:10:05 UTC
README
This tool allows you to add a links section in your sidebar.
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require vmitchell85/nova-links
Next up, you must register the tool with Nova. This is typically done in the tools
method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvider.php // ... public function tools() { return [ // ... new \vmitchell85\NovaLinks\Links(), ]; }
Usage
There are two ways you can add links:
Add Links At Runtime
If you would like to add links at runtime you can add them using the add($linkTitle, $linkUrl, $linkTarget)
function like this:
// in app/Providers/NovaServiceProvider.php // ... public function tools() { return [ // ... (new \vmitchell85\NovaLinks\Links()) ->add('Nova Docs', 'https://nova.laravel.com/docs') ->add('Laravel Docs', 'https://laravel.com/docs', '_blank'), ]; }
Add Links Using the Config File
You can also add links using the config file. First, publish the config file using the following command:
php artisan vendor:publish --provider="vmitchell85\NovaLinks\NovaLinksServiceProvider" --tag="config"
Then open the config file and add your links in the format 'linkName' => 'linkUrl'
// in config/nova-links.php return [ 'links' => [ 'Nova Docs' => 'http://nova.laravel.com/docs', 'Laravel Docs' => 'http://laravel.com/docs' ], ];