This commit is contained in:
Adrian Hopek
2022-01-24 10:23:08 +01:00
parent 75889a16e6
commit 62fc1e1ca9
14 changed files with 51 additions and 37 deletions

View File

@@ -11,12 +11,13 @@ use Toby\Helpers\YearPeriodRetriever;
class SelectedYearPeriodScope implements Scope
{
public function __construct(protected YearPeriodRetriever $yearPeriodRetriever)
{
public function __construct(
protected YearPeriodRetriever $yearPeriodRetriever,
) {
}
public function apply(Builder $builder, Model $model): Builder
{
return $builder->where("year_period_id", $this->yearPeriodRetriever->selected()->id);
}
}
}