extend Post entity with feature slot

Adds nullable feature_slot column (unique) plus repo
findByFeatureSlot/findFeatured/update methods so admins can
pin a post into one of two slots.
This commit is contained in:
Yisroel Baum 2026-05-06 22:28:45 +03:00
parent 64a334c63e
commit f73e5a1af5
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 160 additions and 4 deletions

View file

@ -2,6 +2,8 @@
namespace App\Post;
use RuntimeException;
interface PostRepository
{
public function create(CreatePostDto $dto): Post;
@ -19,4 +21,16 @@ interface PostRepository
public function findRecent(int $limit): array;
public function delete(int $id): void;
/**
* @throws RuntimeException
*/
public function update(Post $post): Post;
public function findByFeatureSlot(int $slot): ?Post;
/**
* @return Post[]
*/
public function findFeatured(): array;
}