LaravelPackages.net
Acme Inc.
Toggle sidebar
opanegro/dot-nova-sidebar-collapse

Create custom menu resources with category collapse and custom icon

23
0
0.0.1
About opanegro/dot-nova-sidebar-collapse

opanegro/dot-nova-sidebar-collapse is a Laravel package for create custom menu resources with category collapse and custom icon. It currently has 0 GitHub stars and 23 downloads on Packagist (latest version 0.0.1). Install it with composer require opanegro/dot-nova-sidebar-collapse. Discover more Laravel packages by opanegro or browse all Laravel packages to compare alternatives.

Last updated

DOT Nova Sidebar Collapse

I'm create from laravel-Nova v2 and this support Laravel Nova v2++

Install:

You can install the package in to a Laravel app that uses Nova via composer:

composer require opanegro/dot-nova-sidebar-collapse

To publish the views nova override navigation and config file run:

php artisan vendor:publish --tag=dot-nova-sidebar-collapse-views
php artisan vendor:publish --tag=dot-nova-sidebar-collapse-config

Then you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

use Opanegro\DotNovaSidebarCollapse\DotNovaSidebarCollapse;

// ...

public function tools()
{
    return [
        // ...
        new DotNovaSidebarCollapse(),
    ];
}

Add $category and $icon in file app/Nova/User.php:

$icon just add one in resources

class User extends Resource
{
    public static $category = 'Management Users';
    
    /** optional */
    public static $icon = '[...svg icon...]';
}

You can add svg icon from zondicons

Usage the svg icon:

  • download zondicons and open *.svg icon in browser
  • [right click] in browser and choose inspect element
  • copy tag svg to variable $icon
  • add class in <svg class="sidebar-icon">
  • add fill in <path fill="var(--sidebar-icon)">

Inspiration By:

  • Group and categorise your nova resources - alexbowers

Credit By:

Star History Chart