num) && ! empty($self->group_key)) { $query = $self->where('group_key', $self->group_key); if (! empty($self->pid)) { $query->where('pid', $self->pid); } $self->num = (int)$query->max('num') + 1; } }); $resetCache = function () { Site::menusResetCache(); }; static::saved($resetCache); static::deleted($resetCache); } /** * Translatable columns * @return array */ public function langColumns() { return ['title']; } }