From ccd4007e84f7d239ba8aadcf7b934f870e950817 Mon Sep 17 00:00:00 2001 From: Fady Mondy Date: Mon, 24 Jun 2024 23:59:45 +0300 Subject: [PATCH] Unable to create model, resource, page etc.. #17 --- src/Resources/TableResource.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/TableResource.php b/src/Resources/TableResource.php index c298ac0..91c6754 100644 --- a/src/Resources/TableResource.php +++ b/src/Resources/TableResource.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Str; use Nwidart\Modules\Facades\Module; use TomatoPHP\FilamentPlugins\Resources\TableResource\Pages; use TomatoPHP\FilamentPlugins\Resources\TableResource\RelationManagers; @@ -141,7 +142,7 @@ public static function table(Table $table): Table return; } - $checkIfModelExists = File::exists(module_path($record->module, '/app/Models/' . str($record->name)->title()->singular() . '.php')); + $checkIfModelExists = File::exists(module_path($record->module, '/app/Models/' . Str::ucfirst(Str::singular(Str::camel($record->name))) . '.php')); if((!$checkIfModelExists) && in_array($data['type'], ['resource', 'page', 'widget'])){