Skip to content

Commit

Permalink
Unable to create model, resource, page etc.. #17
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Jun 24, 2024
1 parent 8a5b979 commit ccd4007
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Resources/TableResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'])){
Expand Down

0 comments on commit ccd4007

Please sign in to comment.