->query(fn (EloquentBuilder $query, $state): EloquentBuilder => $query->hasAuthor($state['value']))
->query(function (Builder $query, array $state) { if (!empty($state['value'])) { $query->hasAuthor($state['value']); } return $query;})
if(!empty($state['value'])) { ... }