Answer the question
In order to leave comments, you need to log in
How to write a route in Laravel?
The site opens along the route
The header and footer of the site are placed in a single template, where I already connect the rest of the site. And then I was impatient to display 3 entries from the blog in the footer. I made a controller with a method:Route::get('','[email protected]');
public function index()
{
$blogs = Blog::join('users', 'author_id','=', 'users.id')
->orderBy('blogs.created_at', 'desc')
->limit(3)
->get();
return view('layouts.layout', compact('blogs'));
}
Route::get('','[email protected]');
Answer the question
In order to leave comments, you need to log in
And what about the routes? We read the documentation in general and about the view composer in particular.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question