Suppose I have this:
//controllers/BlogController.php $data["post"] = $post = Blog::recent_post(); $data["posts_related"] = Blog::posts_related($post->category_id,5); return View::make('blog.home', $data); //views/sidebars/related.blade.php @foreach($posts_related as $r) <p>{{ $r->name }}</p> @endforeach //views/blog/home.blade.php @include('sidebars.related')
My question is: how can I pass:
$data["posts_related"] = Blog::posts_related($post->category_id,5);
For the composer of the presentation, since I cannot pass parameters to the composer of the view, but I cannot be sure.
I appreciate any help!
source share