mirror of
https://github.com/flarum/core.git
synced 2025-10-14 00:15:51 +02:00
47 lines
983 B
PHP
47 lines
983 B
PHP
<?php
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Api\Actions\Discussions;
|
|
|
|
use Flarum\Core\Discussions\Commands\DeleteDiscussion;
|
|
use Flarum\Api\Actions\DeleteAction as BaseDeleteAction;
|
|
use Flarum\Api\Request;
|
|
use Illuminate\Contracts\Bus\Dispatcher;
|
|
|
|
class DeleteAction extends BaseDeleteAction
|
|
{
|
|
/**
|
|
* @var Dispatcher
|
|
*/
|
|
protected $bus;
|
|
|
|
/**
|
|
* @param Dispatcher $bus
|
|
*/
|
|
public function __construct(Dispatcher $bus)
|
|
{
|
|
$this->bus = $bus;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function delete(Request $request)
|
|
{
|
|
$id = $request->get('id');
|
|
$actor = $request->actor;
|
|
$input = $request->all();
|
|
|
|
$this->bus->dispatch(
|
|
new DeleteDiscussion($id, $actor, $input)
|
|
);
|
|
}
|
|
}
|