<?php

namespace App\Models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

class BaseModel extends Model
{
    protected function serializeDate(DateTimeInterface $date): string
    {
        $timezone = config('app.timezone', 'Asia/Shanghai');

        return $date->setTimezone($timezone)->format('Y-m-d H:i:s');
    }
}
