Answer the question
In order to leave comments, you need to log in
How to display turbo pages in Laravel?
I generated one general RSS feed for Turbo pages, they are displayed without problems and Yandex accepted them with great pleasure. The problem is that when trying to generate a separate Turbo page for each article, the application issues: Method Illuminate\View\View::header does not exist .
Do not prompt with what it can be connected?
Controller:
public function article($slug) {
$article = Article::where('slug', $slug)->where('published', 1)->firstOrFail();
return view('template.layouts.single-turbo', [
'articles' => $article
])->header('Content-Type', 'text/xml');
}
Route::get('/blog/{slug?}/turbo', '[email protected]')->name('article');
Answer the question
In order to leave comments, you need to log in
// ...
return response()->view(/*...*/)->header('Content-Type', 'text/xml')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question