From 00bd5b60e63959ad7b6c70a3ea4362e829422fab Mon Sep 17 00:00:00 2001 From: php coder Date: Mon, 28 Aug 2023 10:50:46 +0300 Subject: [PATCH 1/3] use config for model in ResourceLockResource the resource `ResourceLockResource` is not using the config option for the `$model` --- src/Resources/ResourceLockResource.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Resources/ResourceLockResource.php b/src/Resources/ResourceLockResource.php index 94dcc6a..82b57b4 100644 --- a/src/Resources/ResourceLockResource.php +++ b/src/Resources/ResourceLockResource.php @@ -13,10 +13,13 @@ class ResourceLockResource extends Resource { - protected static ?string $model = ResourceLock::class; - protected static ?string $navigationIcon = 'heroicon-o-lock-closed'; + public static function getModel(): string + { + return config('resource-lock.models.ResourceLock', ResourceLock::class); // TODO: Change the autogenerated stub + } + public static function form(Form $form): Form { return $form From 15527c30baa4f9c668ed3c878335d68116d9c522 Mon Sep 17 00:00:00 2001 From: php coder Date: Mon, 28 Aug 2023 11:59:02 +0300 Subject: [PATCH 2/3] Update ManageResourceLocks.php --- src/Resources/ResourceLockResource/ManageResourceLocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/ResourceLockResource/ManageResourceLocks.php b/src/Resources/ResourceLockResource/ManageResourceLocks.php index 2368213..4047c4b 100644 --- a/src/Resources/ResourceLockResource/ManageResourceLocks.php +++ b/src/Resources/ResourceLockResource/ManageResourceLocks.php @@ -16,7 +16,7 @@ protected function getActions(): array return [ Action::make(__('resource-lock::manager.unlock_all')) ->icon('heroicon-o-lock-open') - ->action(fn () => ResourceLock::truncate()) + ->action(fn () => config('resource-lock.models.ResourceLock', ResourceLock::class)::truncate()) ->requiresConfirmation(), ]; } From 2c1f8caebe20cf548335f7655399ab7f0f6fbc97 Mon Sep 17 00:00:00 2001 From: php coder Date: Mon, 28 Aug 2023 12:07:49 +0300 Subject: [PATCH 3/3] Update ResourceLockResource.php --- src/Resources/ResourceLockResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/ResourceLockResource.php b/src/Resources/ResourceLockResource.php index 82b57b4..051a01d 100644 --- a/src/Resources/ResourceLockResource.php +++ b/src/Resources/ResourceLockResource.php @@ -17,7 +17,7 @@ class ResourceLockResource extends Resource public static function getModel(): string { - return config('resource-lock.models.ResourceLock', ResourceLock::class); // TODO: Change the autogenerated stub + return config('resource-lock.models.ResourceLock', ResourceLock::class); } public static function form(Form $form): Form