Nova Perspectives
Visit this package on GitHub

Perspective Selects

Each perspective select is only displayed if at least 2 perspectives exist!

use NormanHuth\NovaPerspectives\Menu\PerspektiveSelect;
 
Nova::mainMenu(function (Request $request) {
return [
PerspektiveSelect::make(),
];
});

To display this element in the user menu must be Nova Menu Advanced installed in version 1.7 or newer!

use NormanHuth\NovaPerspectives\Menu\PerspectiveDisclosure;
 
Nova::userMenu(function (Request $request, Menu $menu) {
$menu->prepend(
PerspectiveDisclosure::make(),
);
 
return $menu;
});

use NormanHuth\NovaPerspectives\Perspective;
 
class MyPerspective extends Perspective
{
/**
* The icons for JSON serialization.
*
* @var array
*/
protected array $icons = [
'fontawesome' => 'fa-brands fa-laravel',
'heroicon' => null,
'image' => null,
'html' => null,
'height' => 18,
];
}

use NormanHuth\NovaPerspectives\Perspective;
 
class MyPerspective extends Perspective
{
/**
* The icons for JSON serialization.
*
* @var array
*/
protected array $icons = [
'fontawesome' => null,
'heroicon' => 'chart-bar',
'image' => null,
'html' => null,
'height' => 18,
];
}

use NormanHuth\NovaPerspectives\Perspective;
 
class MyPerspective extends Perspective
{
/**
* The icons for JSON serialization.
*
* @var array
*/
protected array $icons = [
'fontawesome' => null,
'heroicon' => null,
'image' => null,
'html' => '<svg ...>',
'height' => 18,
];
}

If you don't have Font Awesome integrated in Nova, but want to use it, you can optionally install Font Awesome Free with this command.

php artisan nova-package:font-awesome