*/ protected $hidden = [ 'updated_at', 'deleted_at', ]; /** * @param $value * @return string */ public function getCreatedAtAttribute($value): string { return get_datetime('datetime', strtotime($value)); } /** * A Menu belongs to many roles. * @return BelongsToMany */ public function roles(): BelongsToMany { return $this->belongsToMany( AdminRoles::class, AdminRoleMenu::class, 'menu_id', 'role_id' ); } }