diff --git a/src/State/NotificationProvider.php b/src/State/NotificationProvider.php new file mode 100644 index 0000000..0a1b8b9 --- /dev/null +++ b/src/State/NotificationProvider.php @@ -0,0 +1,33 @@ + + */ +final readonly class NotificationProvider implements ProviderInterface +{ + public function __construct( + private Security $security, + private NotificationRepository $notificationRepository, + ) {} + + public function provide(Operation $operation, array $uriVariables = [], array $context = []): array|object + { + $user = $this->security->getUser(); + + return $this->notificationRepository->findBy( + ['user' => $user], + ['createdAt' => 'DESC'], + 30, + ); + } +}