wamesk/laravel-nova-menu-switcher

There is no license information available for the latest version (1.0.2) of this package.

Installs: 155

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

pkg:composer/wamesk/laravel-nova-menu-switcher

1.0.2 2025-07-07 07:58 UTC

This package is auto-updated.

Last update: 2025-10-07 08:35:22 UTC


README

Description

Creates input select that refreshes page and sets value to session.

img.png

img_1.png

Installation

composer require wamesk/laravel-nova-menu-switcher

Usage

// NovaServiceProvider.php
Nova::mainMenu(function (Request $request) {
    return [
        ...
        Switcher::make([
            'value1' => 'option1',
            'value2' => 'option2',
            'value3' => 'option3',
        ], 'option', 'value2'),
        ...
    ];
});

If you want to control who can use switcher you can add can_use_switcher attribute in user

// User.php
public function getCanUseSwitcherAttribute(): bool
{
    return $this->is_super_admin;
}