PHP code example of gabrieliuga / laravel-nova-sidebar-links
1. Go to this page and download the library: Download gabrieliuga/laravel-nova-sidebar-links library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gabrieliuga / laravel-nova-sidebar-links example snippets
php
NovaServiceProvider.php
namespace App\Providers;
use Giuga\LaravelNovaSidebar\NovaSidebar;
use Giuga\LaravelNovaSidebar\SidebarGroup;
use Giuga\LaravelNovaSidebar\SidebarLink;
...
public function tools()
{
return [
(new NovaSidebar())
->addGroup((new SidebarGroup())
->setName('Utilities')
->addLink((new SidebarLink())
->setName('Telescope')
->setType('_blank')
->setUrl('/telescope')
)
->addLink((new SidebarLink())
->setName('Horizon')
->setType('_blank')
->setUrl('/horizon')
)
)
->addLink((new SidebarLink())
->setUrl('https://google.com')
->setType('_blank')
->setName('Google')
)
];
}
OR
public function tools()
{
return [
(new NovaSidebar())->hydrate([
'Utilities' => [
['Telescope', '/telescope'],
['Horizon', '/horizon'],
['Google', 'https://google.com', '_self']
],
'Google 2' => 'https://google.com'
])
];
}