<?php

namespace App\Repositories\Shop;

use App\Models\Shop\Unity;
use App\Traits\Model\Basic;

class Unities
{
    use Basic;

    public static function getOptions()
    {
        return Unity::orderBy('value', 'asc')->pluck('value', 'id')->toArray();
    }

    public static function getOptionsByPackage($package_id)
    {
        return Unity::byPackage($package_id)->orderBy('value', 'asc')->pluck('value', 'id')->toArray();
    }

    public static function getAll()
    {
        return Unity::orderBy('value', 'asc')->get();
    }

    public static function getName($id)
    {
        return self::get($id)->value ?? null;
    }

    public static function getModel()
    {
        return Unity::query();
    }
}
