26 lines
563 B
PHP
26 lines
563 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Actions\Slides;
|
|
|
|
use App\Contracts\Action;
|
|
use App\Contracts\ActionInput;
|
|
use Webmozart\Assert\Assert;
|
|
|
|
/**
|
|
* @implements \App\Contracts\Action<\App\Actions\Slides\DeleteSlideInput, bool>
|
|
*/
|
|
final class DeleteSlide implements Action
|
|
{
|
|
/**
|
|
* @param \App\Actions\Slides\DeleteSlideInput $input
|
|
*/
|
|
#[\Override]
|
|
public function __invoke(ActionInput $input): bool
|
|
{
|
|
Assert::isInstanceOf($input, DeleteSlideInput::class);
|
|
|
|
return (bool) $input->slide->deleteOrFail();
|
|
}
|
|
}
|