Sort Your Resources in Laravel Nova sidebar

3 minutes reading  ~  125 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 Storage Story

A storage story, behind the scenes of the photo session.

On: 2020/05/28 - 06:12 pm
A Storage Story

Sort Your Resources in Laravel Nova sidebar

laravel nova , it’s a great administration panel for laravel , making it easy to just start your app immediately , this a simple way to sort your Resources in the sidebar .

On: 2019/06/03 - 12:18 pm

Photo by Raphael Nogueira on Unsplash

Sort Your Resources in Laravel Nova sidebar

A Story of A Song

music plays a huge part in my life, so here are some of my life changing songs.

On: 2021/08/10 - 07:16 pm

Photo by Eric Nopanen on Unsplash

A Story of A Song

Life Update #4 the bedroom

life update from my new home

On: 2021/02/19 - 08:09 pm

Life Update #4 the bedroom

Deaths

On: 2021/02/04 - 02:11 am

Photo by S Turby on Unsplash

Deaths

a new repo, Valet Home

a small site build with laravel to be your home page for your laravel valet sites

On: 2021/04/29 - 07:17 pm

Photo by Egor Myznik on Unsplash

a new repo, Valet Home

my office room

Life Update #3 the office room V1

A new site for a new beginning

a new website is a life!

On: 2021/04/10 - 07:27 pm

Photo by Varvara Grabova on Unsplash

A new site for a new beginning