implement ListFeaturedPosts use case
This commit is contained in:
parent
e61492f864
commit
e4791de81a
1 changed files with 21 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Post\UseCases\ListFeaturedPosts;
|
||||||
|
|
||||||
|
use App\Post\Post;
|
||||||
|
use App\Post\PostRepository;
|
||||||
|
|
||||||
|
class ListFeaturedPosts
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private PostRepository $postRepo,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Post[]
|
||||||
|
*/
|
||||||
|
public function execute(): array
|
||||||
|
{
|
||||||
|
return $this->postRepo->findFeatured();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue