Package Data | |
---|---|
Maintainer Username: | vmitchell85 |
Maintainer Contact: | vincent.mitchell@gmail.com (Vince Mitchell) |
Package Create Date: | 2018-08-25 |
Package Last Update: | 2023-03-23 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-08 03:21:10 |
Package Statistics | |
---|---|
Total Downloads: | 485,373 |
Monthly Downloads: | 5,938 |
Daily Downloads: | 181 |
Total Stars: | 36 |
Total Watchers: | 4 |
Total Forks: | 6 |
Total Open Issues: | 1 |
This tool allows you to add a links section in your sidebar.
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(),
];
}
There are two ways you can add links:
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'),
];
}
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'
],
];