Skip to content

Commit

Permalink
Minor doc improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Vervuurt committed Jun 22, 2023
1 parent c829e4f commit 65d9883
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/event-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function filters() : array
}
```

The callback function only gets called on the event if it has an Eloquent model, so `$event->model()` is guaranteed to return a valid model.
The callback function only gets called on the event if it has an Eloquent model, so `$event->model()` is guaranteed to return a valid model in callback methods passed to this type of filter.

### `CallbackFilter`
Define your own custom filtering logic using just a callback method.
Expand All @@ -140,7 +140,7 @@ public function filters() : array
}
```

Since this filter is applied to any event on your calendar, the event is *not* strictly guaranteed to contain a Nova resource and an Eloquent model before the callback method gets called, so you need to do checks before using the `model()` and `resource()` methods. If you only want to show calendar events that have underlying Eloquent models anyway, use an [`EloquentCallbackFilter`](#eloquentcallbackfilter) instead.
Since this filter is applied to any event on your calendar, the event is *not* strictly guaranteed to contain a Nova resource and an Eloquent model before the callback method gets called, so you need to do checks before using the `model()` and `resource()` methods. If you want the filter to show only calendar events that have underlying Eloquent models anyway, use an [`EloquentCallbackFilter`](#eloquentcallbackfilter) instead.

In practice, using this filter type is only required if your `nonNovaEvents` method returns calendar events without Eloquent models.

Expand Down

0 comments on commit 65d9883

Please sign in to comment.