'

' . strval(trans('firefly.route_has_no_help')) . '

', 'title' => $title, ]; $result = Requests::get($uri); if ($result->status_code === 200) { $content['text'] = $result->body; } if (strlen(trim($content['text'])) == 0) { $content['text'] = '

' . strval(trans('firefly.route_has_no_help')) . '

'; } $converter = new CommonMarkConverter(); $content['text'] = $converter->convertToHtml($content['text']); return $content; } /** * * @param string $route * * @return bool */ public function hasRoute(string $route):bool { return Route::has($route); } /** * * @param string $route * * @return bool */ public function inCache(string $route):bool { return Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text'); } /** * * @param string $route * @param string $language * @param array $content * * @internal param $title */ public function putInCache(string $route, string $language, array $content) { Cache::put('help.' . $route . '.text.' . $language, $content['text'], 10080); // a week. Cache::put('help.' . $route . '.title.' . $language, $content['title'], 10080); } }