fjffk简单的咖啡店科开发2方法2 环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdfPKi„W]}۱z²+²+ExtensionRepository.phpnu„[µü¤request('get', '', [ 'endpoint' => 'find', 'slug' => $slug ]); if ($response->ok()) { $data = $response->json('data'); $extension = Extension::query()->firstWhere('slug', $slug); return array_merge($data, [ 'only_show' => Str::contains($extension['slug'] ?? '', ['only-show']), 'db_version' => $extension?->version, 'installed' => (bool) $extension?->installed, 'upgradable' => $extension && isset($data['version']) && $extension->version !== $data['version'], ]); } return []; } /** * Finds an extension model from the local database. * This method fulfills the interface requirement. */ public function findBySlugInDb(string $slug): Model|Builder|null { return Extension::query()->where('slug', $slug)->first(); } /** * Fetches a list of all extensions or themes from the remote API. */ public function all(bool $isTheme = false): array { $endpoint = $isTheme ? 'theme' : 'extension'; $response = $this->request('get', '', [ 'endpoint' => $endpoint, ]); if ($response->ok()) { $data = $response->json('data'); $this->banners = $response->json('banners') ?: []; $this->updateExtensionsTable($data); return $this->mergedInstalled($data); } return []; } /** * Downloads the extension zip file from the remote API. */ public function install(string $slug, string $version): Response { return $this->request('post', "extension/{$slug}/install/{$version}"); } /** * A generic check method that likely fulfills the interface contract. * The original `check` method was implemented as middleware, which caused the error. * It has been renamed to `handleLicenseCheckMiddleware`. */ public function check($request = null, Closure $next = null): bool { $domain = request()->getHost(); return cache()->remember('check_license_domain_' . $domain, 60 * 60 * 24, function () { return $this ->request('post', 'check') ->json('licensed', false); }); } /** * Fetches extensions intended for the support page. */ public function supportExtensions(): array { $response = $this->request('get', '', [ 'endpoint' => 'extension', ]); if ($response->ok()) { $data = $response->json('data'); $this->banners = $response->json('banners') ?: []; $this->updateExtensionsTable($data); return $this->mergedInstalled($data); } return []; } /** * Get subscription information */ public function subscription(): Response { return $this->request('get', 'subscription'); } /** * Get subscription payment method */ public function subscriptionPayment(): string { return cache()->remember('subscription_payment', 60 * 60 * 24, function () { $subscriptionResponse = $this->subscription(); if ($subscriptionResponse->ok() && $subscriptionResponse->json('payment')) { return $subscriptionResponse->json('payment'); } return ''; }); } /** * Get cart information */ public function cart(): ?array { $response = $this->request('get', 'cart' . DIRECTORY_SEPARATOR . $this->domainKey()); if ($response->successful()) { return $response->json(); } return []; } /** * Check if domain is blacklisted */ public function blacklist(): bool { return $this ->request('post', 'blacklist') ->json('blacklist', false); } //====================================================================== // ALL OTHER ORIGINAL METHODS //====================================================================== public function deleteCoupon(): array { $response = $this->request( 'get', 'cart/coupon' . DIRECTORY_SEPARATOR . $this->domainKey() . '/delete' ); if ($response->successful()) { return $response->json(); } return ['status' => 'error', 'message' => trans('An error occurred while deleting the coupon.')]; } public function storeCoupon(string $couponCode): array { $response = $this->request( 'post', 'cart/coupon' . DIRECTORY_SEPARATOR . $this->domainKey(), [ 'coupon_code' => $couponCode, ] ); if ($response->successful()) { return $response->json(); } return ['status' => 'error', 'message' => trans('An error occurred while applying the coupon.')]; } public function licensed(array $data): array { return $data; } public function paidExtensions(): array { return collect($this->themes()) ->sortBy('id') ->merge($this->extensions()) ->where('price', '>', 0) ->filter(function ($extension) { return ! Str::contains($extension['slug'], ['cart']); })->toArray(); } public function banners(): ?array { if (!empty($this->banners)) { return $this->banners; } $this->all(); return $this->banners ?: []; } public function extensions(): array { return collect($this->all())->filter(function ($extension) { return ! Str::contains($extension['slug'], ['cart']); })->toArray(); } public function themes(): array { return collect($this->all(true))->filter(function ($theme) { return ! Str::contains($theme['slug'], ['cart']); })->toArray(); } public function findId(int $id) { return collect($this->extensions())->where('id', $id)->first(); } public function findSupport(string $slug): array { return $this->find($slug); // The logic was identical to find(), so reusing it. } public function appVersion(): bool|string|int { $file = base_path('version.txt'); if (file_exists($file)) { return trim(file_get_contents($file)); } return self::APP_VERSION; } //====================================================================== // RENAMED MIDDLEWARE METHOD //====================================================================== /** * This was the original 'check' method. Its signature is for middleware, * so it has been renamed to avoid conflicts with the interface contract. */ public function handleLicenseCheckMiddleware(Request $request, Closure $next) { // Now calls the new, corrected check() method if (! $this->check()) { if (Storage::disk('local')->exists('portal')) { Storage::disk('local')->delete('portal'); } SettingTwo::getCache()->update(['liquid_license_domain_key' => null]); cache()->forget('check_license_domain_' . $request->getHost()); return redirect()->route('LaravelInstaller::license')->with(['message' => 'License for this domain is invalid. Please contact support.']); } return $next($request); } //====================================================================== // HELPER AND PRIVATE METHODS //====================================================================== public function request(string $method, string $route, array $body = [], $fullUrl = null) { $fullUrl = $fullUrl ?? rtrim(self::API_URL, '/') . '/' . ltrim($route, '/'); return Http::withHeaders([ 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'x-license-type' => $this->licenseType(), 'x-app-key' => $this->appKey(), 'x-app-version' => (string) $this->appVersion(), ])->timeout(60)->{$method}($fullUrl, $body); } public function mergedInstalled(array $data): array { $extensions = Extension::query()->get(); return collect($data)->map(function ($extension) use ($extensions) { $value = $extensions->firstWhere('slug', $extension['slug']); return array_merge($extension, [ 'only_show' => Str::contains($extension['slug'], ['only-show']), 'db_version' => $value?->version, 'installed' => (bool) $value?->installed, 'upgradable' => $value && isset($extension['version']) && $value->version !== $extension['version'], ]); })->toArray(); } private function updateExtensionsTable(array $data): void { foreach ($data as $extension) { Extension::query()->updateOrCreate([ 'slug' => $extension['slug'], ], [ 'is_theme' => $extension['is_theme'], 'version' => $extension['version'], ]); } } private function dbExtensionCount(bool $isTheme = false): int { return Extension::query() ->where('is_theme', $isTheme) ->count(); } public function appKey() { return md5(config('app.key')); } public function licenseType() { return app(ApplicationStatusRepository::class)->getVariable('liquid_license_type') ?: Helper::settingTwo('liquid_license_type'); } public function domainKey() { return app(ApplicationStatusRepository::class)->getVariable('liquid_license_domain_key') ?: Helper::settingTwo('liquid_license_domain_key'); } }PKi„W]o_ôƋ‹'Contracts/PortalRepositoryInterface.phpnu„[µü¤