(string) $this->encodePrimaryKey($account->id), 'default_url' => config('ninja.app_url'), 'plan' => $account->getPlan(), 'plan_term' => (string) $account->plan_terms, 'plan_started' => (string) $account->plan_started, 'plan_paid' => (string) $account->plan_paid, 'plan_expires' => (string) $account->plan_expires, 'user_agent' => (string) $account->user_agent, 'payment_id' => (string) $account->payment_id, 'trial_started' => (string) $account->trial_started, 'trial_plan' => (string) $account->trial_plan, 'plan_price' => (float) $account->plan_price, 'num_users' => (int) $account->num_users, 'utm_source' => (string) $account->utm_source, 'utm_medium' => (string) $account->utm_medium, 'utm_content' => (string) $account->utm_content, 'utm_term' => (string) $account->utm_term, 'referral_code' => (string) $account->referral_code, 'latest_version' => (string) trim($account->latest_version), 'current_version' => (string) config('ninja.app_version'), 'updated_at' => (int) $account->updated_at, 'archived_at' => (int) $account->deleted_at, 'report_errors' => (bool) $account->report_errors, 'debug_enabled' => (bool) config('ninja.debug_enabled'), 'is_docker' => (bool) config('ninja.is_docker'), 'is_scheduler_running' => (bool) $account->is_scheduler_running, 'default_company_id' => (string) $this->encodePrimaryKey($account->default_company_id), ]; } public function includeCompanyUsers(Account $account) { $transformer = new CompanyUserTransformer($this->serializer); return $this->includeCollection($account->company_users, $transformer, CompanyUser::class); } public function includeDefaultCompany(Account $account) { $transformer = new CompanyTransformer($this->serializer); return $this->includeItem($account->default_company, $transformer, Company::class); } public function includeUser(Account $account) { $transformer = new UserTransformer($this->serializer); return $this->includeItem(auth()->user(), $transformer, User::class); // return $this->includeItem($account->default_company->owner(), $transformer, User::class); } }