'boolean', ]; /** * Get users belonging to this branch */ public function users() { return $this->hasMany(User::class, 'branch_code', 'code'); } /** * Scope to get only active branches */ public function scopeActive($query) { return $query->where('is_active', true); } }