company_id = $company_id; } /** * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { $this->company = Company::find($this->company_id); return $this->company->clients()->count() < $this->company->account->hosted_client_count; } /** * @return string */ public function message() { return ctrans('texts.limit_clients', ['count' => $this->company->account->hosted_client_count]); } }