Sort Your Resources in Laravel Nova sidebar
3 minutes reading  ~  54 visits
On: 2019/06/03 - 12:18 pm
Laravel dev talks

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 someone.

A new site for a new beginning

Photo by Varvara Grabova on Unsplash

A new site for a new beginning

a new website is a life!

On: 2021/04/10 - 07:27 pm
A Story of A Song

A Story of A Song Photo by Eric Nopanen on Unsplash

music plays a huge part in my life, so here are some of my life changing songs. On: 2021/08/10 - 07:16 pm

A new restart | dev talk

Photo by Yancy Min on Unsplash

A new restart | dev talk

a new laravel package for the Ar-PHP Project

On: 2021/04/06 - 08:15 pm