Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
This package is possibly abandoned. Please proceed with care.

Readme

New alternative Method: https://gist.github.com/jbrooksuk/c7c1ab6ea094a29d7dbb1fbdb17d05e1

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.

Screenshots

Reviews

By Ed Anisko on July 8, 2020

Works

Back to Top
Added 5 years ago
Last updated 5 Years Ago
Version 1.0.8
Nova Version *
Composer
normanhuth/nova-menu-order
GitHub stars 3
Packagist downloads 11,243

Favorites

8 users favorited

Rating

5.00
(out of 5)
★★★★★
★★★★
★★★
★★
4 ratings

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas