model.beforeFetch

Called before the model is fetched

Note: also triggered in Winter\Storm\Halcyon\Model

Example usage:

$model->bindEvent('model.beforeFetch', function () use (\Winter\Storm\Database\Model $model) { if (!\Auth::getUser()->hasAccess('fetch.this.model')) { throw new \Exception("You shall not pass!"); } });

Usage

Triggers

Class or file Line
Winter\Storm\Database\Model 463
Copyright © 2024 Winter CMS