getPerson($id); $page = request()->query('page', 1); ['data' => $data, 'pagination' => $pagination, 'name' => $name] = $this->formatTmdbPersonResponse($results, $page); $page_text = ($page > 1) ? sprintf(' - Page %s', $page) : ''; // dd($pagination); $data = $pagination->items(); $meta = []; $meta['title'] = str(config('site.people.cast.title'))->replace(['{NAME}'], $name)->replace(['{PAGE}'], $page_text)->apa(); $meta['page_title'] = str(config('site.people.cast.page_title'))->replace(['{NAME}'], $name)->replace(['{PAGE}'], $page_text)->apa(); $meta['description'] = str(config('site.people.cast.description'))->replace(['{NAME}'], $name)->replace(['{PAGE}'], $page_text); $meta['keywords'] = config('site.people.cast.keywords', false); $meta['image'] = asset('images/cover.jpg'); $meta['route'] = Route::current(); // dd($meta['route']); // $query = str($query)->apa(); // sleep(2); return view('list', compact('data', 'pagination', 'meta', 'id')); } public function more(TmdbClient $tmdbClient, MorePersonCastRequest $request):JsonResponse { $results = $tmdbClient->getPerson($request->validated()['person_id']); $page = request()->query('page', 1); ['data' => $data, 'pagination' => $pagination, 'name' => $name] = $this->formatTmdbPersonResponse($results, $request->validated()['page']); $items = $pagination->items(); $has_more_pages = $pagination->hasMorePages(); $current_page = $pagination->currentPage(); $html = LaravelHtmlMinifyFacade::htmlMinify(view('components.more_titles', compact('items'))->render()); return response()->json(compact('current_page', 'has_more_pages', 'html')); } }