<?php

namespace App\Repositories;

use App\Models\SubscriptionDuration;
use Illuminate\Database\Eloquent\Model;

class SubscriptionDurationRepository extends BaseRepository
{
    public function __construct(SubscriptionDuration $model)
    {
        parent::__construct($model);
    }

    public function create(array $attributes): Model
    {
        return parent::create($attributes);
    }

    public function update(Model $model, array $attributes): bool
    {
        return parent::update($model, $attributes);
    }

    public function getActiveDurations()
    {
        return $this->model->active()->orderBy('name->en')->get();
    }
}
