Menus

Navigation around your application

Menus allow users to create or edit menus that can be used inside your applications. These menus can be nested as many as they want without limit, and each menu has its own type so that users can be redirected to their corresponding type.

Custom menu type

<?php
namespace App\Core;
use ReflectionClass;
use Illuminate\Support\Str;
abstract class MenuType
{
public function getName()
{
return Str::title(str_replace('-', ' ', Str::kebab((new ReflectionClass($this))->getShortName())));
}
public function getSlug()
{
return Str::slug($this->getName());
}
public function hasOptions()
{
return false;
}
public function getOptions()
{
return [];
}
public function getOptionTrackBy()
{
return 'slug';
}
public function getOptionLabel()
{
return 'title';
}
}

Register Custom Menu Type

config('cms.menus.types')