IG
Size: a a a
IG
E
IG
IG
E
K
public function video(Category $category, Video $video){
$videos = $category
->videos()
->orderBy('created_at', 'DESC')
->paginate(6)
->map(function (Video $video) use ($category) {
return $video->setRelation('category', $category);
});
$lastposts = Post::select('id', 'title','created_at', 'counter', 'category_id')
->with('category')
->orderBy('created_at', 'DESC')
->limit(5)
->get();
return view('video.list', compact('category', 'lastposts', 'videos'));
}
E
lastposts
- можно вынестиK
IG
E
E
K
IG
IG
E
E
IG
E
E
IG