Replies: 2 comments 5 replies
-
|
You can just extend the relevant Resource if you have this requirement: <?php
namespace App\Nova;
use Laravel\Nova\Http\Requests\NovaRequest;
use Sereny\NovaPermissions\Nova\Resource as NovaResource;
abstract class Resource extends NovaResource
{
/**
* Indicates whether Nova should check for modifications between viewing and updating a resource.
*
* @var bool
*/
public static $trafficCop = false; |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Please note that I don't have a problem with the user and attended resource since I add The problem with the vendor's third-party plugins! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When using the serenysoft/nova-permissions package along with Laravel Nova, updating resources inside the Nova dashboard fails with the error message: "Another user has updated this resource since this page was loaded. Please refresh the page and try again."
This issue occurs browser time zones are NOT in sync with the server
(That is what Nova support responds to me).Steps to Reproduce
Install the
serenysoft/nova-permissionspackage in a Laravel Nova project.Create a resource and attach permission to it using the
serenysoft/nova-permissionspackage.Attempt to update the resource permission inside the Nova dashboard.
The update will fail with the error message: "Another user has updated this resource since this page was loaded. Please refresh the page and try again."
Expected Behavior
The update should be successful without any error messages.
Actual Behavior
The update fails with the error message: "Another user has updated this resource since this page was loaded. Please refresh the page and try again."
Environment
Laravel Version:10
Nova Version: 4.x
serenysoft/nova-permissions PackageServer Timezone:
UTCMySQL Timezone:
UTCLaravel Timezone in app.php:
UTCBrowser Timezne:
UnknownWorkaround
Disabling the trafficCop feature by setting public static
$trafficCop = false;in app/Nova/Resources.php resolves the issue for resources defined in the app/Nova directory.However, this solution does not work for resources defined in the
serenysoft/nova-permissionspackage, which has its own vendor/sereny/nova-permissions/src/Nova/Resource.php file that extends the main vendor/laravel/nova/src/Resource.php file. which means it ignores "app/Nova/Resources.php" altogether.Any plugin may have this method of OOP and we can not follow all plugins!
Despite updating the plugin to solve the problem but any time I do composer update , all my modifications will be lost.
Expected Solution
I suggest adding a configuration flag in Laravel Nova's configuration file that can be used to disable the trafficCop feature globally. This will allow users to use third-party packages like
serenysoft/nova-permissionswithout encountering conflicts with the trafficCop feature.Beta Was this translation helpful? Give feedback.
All reactions