vmitchell85 / nova-links by vmitchell85

Add custom links to your nova navigation
443,916
36
4
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-04-18 15:26:32
Package Statistics
Total Downloads: 443,916
Monthly Downloads: 6,246
Daily Downloads: 290
Total Stars: 36
Total Watchers: 4
Total Forks: 5
Total Open Issues: 1

Add custom links to your nova navigation

Latest Version on Packagist Total Downloads

This tool allows you to add a links section in your sidebar.

alt text

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'
    ],
];