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