public function __construct($data) { if ($data instanceof Filter) { $data->processFields(); $data->process(); } parent::__construct($data->data()); }
public function __construct($data) { if (is_subclass_of($data, Model::class)) { $data = new $data(); } if ($data instanceof Model) { $data = $data->newQuery(); } parent::__construct($data); }