update deploy
This commit is contained in:
21
app/Actions/Announcement/DeleteAnnouncementAction.php
Normal file
21
app/Actions/Announcement/DeleteAnnouncementAction.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Announcement;
|
||||
|
||||
use App\Events\ModelChanged;
|
||||
use App\Models\Announcement;
|
||||
use App\Repositories\Contracts\AnnouncementRepositoryInterface;
|
||||
|
||||
final class DeleteAnnouncementAction
|
||||
{
|
||||
public function __construct(private AnnouncementRepositoryInterface $repository) {}
|
||||
|
||||
public function execute(Announcement $announcement): bool
|
||||
{
|
||||
$this->repository->delete($announcement);
|
||||
|
||||
ModelChanged::dispatch(Announcement::class, 'deleted');
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user