Sort Your Resources in Laravel Nova sidebar
1 minute reading  ~  34 visits
Publication Date: 2019/06/03 - 12:35 pm

laravel nova , it’s a great administration panel for laravel , making it easy to just start your app immediately .

in nova , when you group all the resources with :

public static $group  = "admin";

nova will display all the resources without any sorting , you can simply fix this by adding the property :

public static $sorting = 1;

and in your navigation.blade.php

after :

@if (count($resources) > 0)

add :

@php
$resources = $resources->sortBy(function($resource){
return $resource::$sorting ?? 1;
});
@endphp

this will display the in the desired sorting .


I hope this would help some one .



Copyright 2019 - atm-code
made with ❤️ by Wink and tailwindcss