<?php namespace App\Posts;
class PostComposer
{
/** @var PostService $postService */
private $postService;
public function __construct()
{
$this->postService = app()->make(PostService::class);
}
public function getLatestPosts($view)
{
$view->with('composedPosts', $this->postService->getLatestPosts());
}
public function getAllPosts($view)
{
$view->with('composedPosts', $this->postService->getAllPosts());
}
}