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