<?php
/**
 *  模型公共部分
 * @file:${FILE_NAME}
 * @Created by gnitif
 * @Date: 2023/5/6
 * @Time: 15:21
 */


namespace Modules\Common\Models;

use Catch\Base\CatchModel as Model;
use Illuminate\Database\Eloquent\Builder;

class BaseModel extends Model
{

    protected array $defaultHidden = [];

    protected array $defaultCasts = [
        'created_at' => 'datetime:Y-m-d H:i:s',

        'updated_at' => 'datetime:Y-m-d H:i:s',
    ];
    protected $dateFormat = '';

    public static function bootSoftDeletes(): void{

    }


    public function scopeActive(Builder $query): void
    {
        $query->where($this->table.'.is_enabled', 1);
    }
}
