Skip to content

Commit

Permalink
Merge pull request #33 from a21ns1g4ts/secure_global_observer_registr…
Browse files Browse the repository at this point in the history
…ation_for_models

Secure Global Observer Registration for Models
  • Loading branch information
MarJose123 authored Nov 7, 2024
2 parents 4dbfa10 + 84a54f4 commit 46653c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/FilamentWebhookServerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public function boot(): void

private static function registerGlobalObserver(): void
{
/** @var Model[] $MODELS */
$MODELS = [
config('filament-webhook-server.models'),
];
/** @var array|string[] $MODELS */
$MODELS = config('filament-webhook-server.models', []);

foreach ($MODELS as $MODEL) {
foreach ($MODEL as $model) {
$model::observe(ModelObserver::class);
if (class_exists($model)) {
$model::observe(ModelObserver::class);
}
}
}
}
Expand Down

0 comments on commit 46653c0

Please # to comment.