Skip to content

magentix98/nova-menu-order

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sort the Nova resources and resource groups in the menu.

Install:
composer require normanhuth/nova-menu-order

Now publish the config file:
php artisan vendor:publish --provider="NormanHuth\NovaMenuOrder\NovaMenuOrderServiceProvider" --tag=config

After publish this, You find the file config/nova-group-order.php, where You can sort the resources groups:

 return [
     'Other'     => 10,
     'Archives'  => 20,
 ];

If the file resources/views/vendor/nova/resources/navigation.blade.php not exists, You can publish this file:
php artisan vendor:publish --provider="NormanHuth\NovaMenuOrder\NovaMenuOrderServiceProvider" --tag=view

If this file already exist, You have 2 Options.
Option 1:
Overwrite the file with:
php artisan vendor:publish --provider="NormanHuth\NovaMenuOrder\NovaMenuOrderServiceProvider" --tag=view --force

Option 2:
Edit the file and change {{ $group }} to {!! $group !!} and {{ $resource::label() }} to {!! $resource::label() !!}


Use this package in the Nova resources:

use NormanHuth\NovaMenuOrder\Nova\CustomResource;

class Contact extends CustomResource

And to order the resources:

use NormanHuth\NovaMenuOrder\Nova\CustomResource;

class Contact extends CustomResource
{
    public static $order = 20;

Localize Labels - use alternative method

    public static function setLabel()
    {
        return __('Contact');
    }
    public static function setSingularLabel()
    {
        return __('Contact');
    }

If You use klepak/nova-dynamic-page-title, You find in the folder nova-dynamic-page-title a custom JS-asset to override, change, edit this package.

About

Sort the Nova resources and resource groups in the menu.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 37.3%
  • JavaScript 32.6%
  • Blade 30.1%