Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Fixing the menu no longer displaying since 4.2.5 additionally fixed an asset issue from leftover code calling css/js assets that dont exist and are not required.
  • Loading branch information
moroneyio committed May 12, 2022
1 parent 0ad813e commit 4830f9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions resources/lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

return [
'sidebar_label' => 'Roles & Permissions',
'sidebar_label_roles' => 'Roles',
'sidebar_label_permissions' => 'Permissions',
'name' => 'Name',
'display_name' => 'Display Name',
'guard_name' => 'Guard Name',
Expand Down
21 changes: 9 additions & 12 deletions src/Novaspatiepermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
use Laravel\Nova\Menu\MenuSection;
use Laravel\Nova\Nova;
use Laravel\Nova\Tool;
use Spatie\Permission\Models\Role as SpatieRole;

class Novaspatiepermissions
extends Tool

class Novaspatiepermissions extends Tool
{
public $roleResource = Role::class;
public $roleResource = Role::class;
public $permissionResource = Permission::class;

public $registerCustomResources = false;
Expand All @@ -24,8 +25,6 @@ class Novaspatiepermissions
*/
public function boot()
{


if ((Role::class === $this->roleResource && Permission::class === $this->permissionResource)
|| $this->registerCustomResources) {
Nova::resources([
Expand All @@ -34,11 +33,6 @@ public function boot()
]);
}


Nova::script('novaspatiepermissions', __DIR__.'/../dist/js/tool.js');
Nova::style('novaspatiepermissions', __DIR__.'/../dist/css/tool.css');


}

public function roleResource(string $roleResource)
Expand Down Expand Up @@ -71,12 +65,15 @@ public function withRegistration()
*/
public function menu(Request $request)
{

return [

MenuSection::make(__('nova-spatie-permissions::lang.sidebar_label'), [
MenuItem::resource(Role::class),
MenuItem::resource(Permission::class),
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_roles'), 'resources/roles'),
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_permissions'), 'resources/permissions'),
])->icon('key')->collapsable(),

];
}
}

0 comments on commit 4830f9a

Please sign in to comment.