<?php

namespace App\Models;

use App\Traits\Multitenantable;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

class Unit extends Model
{
    use Multitenantable;

    public $primaryKey = 'uuid';

    public $incrementing = false;

    public $keyType = 'string';

    protected $fillable = [
        'uuid',
        'tenant_id',
        'name'
    ];

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
    ];

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
}
