diff --git a/src/Console/GenerateGraphQLSchemaFromEloquentCommand.php b/src/Console/GenerateGraphQLSchemaFromEloquentCommand.php index fc2f89c..ebede64 100644 --- a/src/Console/GenerateGraphQLSchemaFromEloquentCommand.php +++ b/src/Console/GenerateGraphQLSchemaFromEloquentCommand.php @@ -543,8 +543,14 @@ public function handle() if (!empty($excludeModels)) { $models = array_filter( $models, - fn ($model) => - !(in_array($model, $excludeModels) || in_array(self::getModelClassName($model), $excludeModels)) + function ($model) use ($excludeModels) { + foreach ($excludeModels as $excludeModel) { + if (fnmatch($excludeModel, $model) || fnmatch($excludeModel, self::getModelClassName($model))) { + return false; + } + } + return true; + } ); }