<?php

namespace App\Models;

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

class Cate extends Model
{
    use HasFactory;
    protected $table='cate';
    protected $guarded=[];
    protected function serializeDate(DateTimeInterface $date): string
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function cate(): \Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(Cate::class,'pid','id');
    }
}
