findWhere([ 'company_id' => $company->id ])->count(); } public function getByApiKey($apiKey) { return $this->findWhere([ 'api_key' => $apiKey ])->first(); } }