Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // app/Service/PostTest.php
- namespace App\Service;
- use App\Post;
- use App\Repository\PostRepository;
- class PostTest
- {
- /** @var PostRepository */
- private $repository;
- /** @var SubscriberNotifier */
- private $notifier;
- public function __construct(PostRepository $repository, SubscriberNotifier $notifier)
- {
- $this->repository = $repository;
- $this->notifier = $notifier;
- }
- public function create(Post $post)
- {
- $this->repository->persist($post);
- $this->notifier->notifyCreate($post);
- }
- }
- //laravel loC
- https://github.com/shfx17
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement