serenysoft / nova-permissions

Laravel Nova 4 Roles & Permissions
72 stars 25 forks source link

Conflict with nova trafficCop #22

Closed beshoo closed 1 year ago

beshoo commented 1 year ago

https://github.com/laravel/nova-issues/discussions/5639

Please follow Nova team advice

leandrogehlen commented 1 year ago

You can customize your resource

https://github.com/serenysoft/nova-permissions#customizations

beshoo commented 1 year ago

I don't understand, i will be thankful for you if you could show me an example.

leandrogehlen commented 1 year ago

app/Nova/Role.php

<?php

namespace App\Nova;

use Sereny\NovaPermissions\Nova\Role as BaseRole;

class Role extends BaseRole
{
    /**
     * Indicates whether Nova should check for modifications between viewing and updating a resource.
     *
     * @var bool
     */
    public static $trafficCop = false;
}

app/Providers/NovaServiceProvider.php

<?php

namespace App\Providers;

use Sereny\NovaPermissions\NovaPermissions;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    ...

    /**
     * Get the tools that should be listed in the Nova sidebar.
     *
     * @return array
     */
    public function tools()
    {
        return [
            NovaPermissions::make()                
                ->roleResource(App\Nova\Role::class)
        ];
    }
}
beshoo commented 1 year ago

Thank you so much.

Solved