'int', 'sort_order' => 'int', 'is_active' => 'bool', ]; protected $hidden = [ 'deleted_at', ]; // ========================================================================= // 상수 // ========================================================================= public const TYPE_RANK = 'rank'; // 직급 public const TYPE_TITLE = 'title'; // 직책 // ========================================================================= // 스코프 // ========================================================================= public function scopeRanks($query) { return $query->where('type', self::TYPE_RANK); } public function scopeTitles($query) { return $query->where('type', self::TYPE_TITLE); } public function scopeActive($query) { return $query->where('is_active', true); } public function scopeOrdered($query) { return $query->orderBy('sort_order'); } }