vyuldashev / nova-permission

A Laravel Nova tool for Spatie's laravel-permission library
https://novapackages.com/packages/vyuldashev/nova-permission
419 stars 217 forks source link

Error on update role and update user role #166

Closed MarcosGit closed 3 years ago

MarcosGit commented 3 years ago

Hi, everyone i create 4 permissions with API guard name and i update all to WEB guard name and now when i try to add this permissions to role i get error 409 Conflict.

If i try to update user and add role i get error 409 Conflict with message: Other user update this resource since the page was loaded. Please refresh the page and try again.

When i update the page and try again i get this error again.

Please someone can help me bypass this.

Screenshot(5)

RVxLab commented 3 years ago

It sounds like something is changing your user model as you try to update it. Do you have an updating observer on that model? Check your network tab as well, maybe something is causing an update that you can see. Otherwise I recommend you install Laravel Debug Bar, maybe that can reveal something.

MarcosGit commented 3 years ago

Thank you RVxLab for your replay, I get this error on server production and staging, on my local computer its work great.

MarcosGit commented 3 years ago

I dont now why i get this error but i find some thing in nova documentation, so i will move this issue to laravel nova.

Preventing Conflicts

If the model has been updated since its last retrieval, Nova will automatically respond with a 409 Conflict status code and display an error message to prevent unintentional model changes. This may occur if another user updates the model after you have opened the "Edit" screen on the resource. This feature is also known as "Traffic Cop".

Disabling Traffic Cop

If you are not concerned with preventing conflicts, you can disable the Traffic Cop feature on resource class: public static $trafficCop = false;