Perspective Selects
Each perspective select is only displayed if at least 2 perspectives exist!
PerspektiveSelect
use NormanHuth\NovaPerspectives\Menu\PerspektiveSelect; Nova::mainMenu(function (Request $request) { return [ PerspektiveSelect::make(), ];});
PerspectiveDisclosure
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;});
Icons
Font Awesome
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, ];}
Heroicon
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, ];}
SVG
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, ];}
Optional: Install Font Awesome
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