where('is_deleted', '=', 0); } public function scopeDeleted(Query $query): void { $query->where('is_deleted', '=', 1); } public static function types() { return static::mk()->group('type')->field('type')->select(); } public function creator() { return $this->hasOne(StaffUser::class, 'id', 'create_by')->with(['dept']); } }