<?php

namespace App\Service\Units;

use App\Models\Units;

class UnitService
{
    public static function UnitCreate(array $data)
    {
        $collect = collect($data);

        return Units::create(
            $collect->toArray()
        );
    }

    public static function UnitUpdate(array $data, $id)
    {
        $collect = collect($data);
        Units::find($id)->update($collect->toArray());
    }
}
