bearer_token, Crypt::decryptString(self::$service->bearer_pwd) ); } /** * Get customer. * * @param boolean $status * @return array */ protected static function getCustomer(bool $status = true): array { /** @var \App\Models\Costumer $customer */ $customer = Customer::whereHas('logins', function ($q) use ($status) { $q->where('status', $status); })->inRandomOrder()->firstOrFail(); /** @var \App\Models\Brand $brand */ $login = $customer->logins()->where('status', $status)->firstOrFail(); /** @var \App\Models\CustomerLogin $login */ $brand = $login->brand; /** @var \App\Models\Service $service */ $service = $brand->services()->firstOrFail(); // Get customer info. $info = $customer->info($brand, Customer::FIRST_OR_FAIL); return compact('customer', 'service', 'brand', 'login', 'info'); } /** * Parse routes.json and return routes list. * * @return array */ protected function getClientRoutes(): array { return \json_decode(\file_get_contents(__DIR__ . '/../../client/src/routes.json'), true); } }