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'])){