\App\ModelsBaseModel

非认证模型的基类

职责:为普通 Eloquent 模型(Role、Menu、Permission 等)统一注入 HasTimestamps,使 create_time/update_time 字段映射与日期序列化 格式全库一致。

需要认证的模型(如 SysUser)请直接 use HasTimestamps Trait,而非继承本类。

Summary

Methods
Properties
Constants
timestampCasts()
$timestamps
No constants found
serializeDate()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$timestamps

$timestamps

Methods

timestampCasts()

timestampCasts() : array<string,string>

全库统一的时间列 cast 段(单源:约 22 个模型 casts() 内重复的两行)。 使用方模型 casts() 内 `return array_merge(self::timestampCasts(), [...])`。

Returns

array

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

所有日期属性统一按 "年-月-日 时:分:秒" 序列化。

Parameters

\DateTimeInterface $date

Returns

string —