Added RemoveUserCommand

This commit is contained in:
James Brooks
2015-08-26 13:28:10 +01:00
parent 7be3aa2552
commit c466620435
4 changed files with 108 additions and 1 deletions

View File

@@ -12,14 +12,18 @@
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
use AltThree\Validator\ValidationException;
use CachetHQ\Cachet\Commands\User\RemoveUserCommand;
use CachetHQ\Cachet\Models\User;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
class TeamController extends Controller
{
use DispatchesJobs;
/**
* Shows the team members view.
*
@@ -116,7 +120,7 @@ class TeamController extends Controller
*/
public function deleteUser(User $user)
{
$user->delete();
$this->dispatch(new RemoveUserCommand($user));
return Redirect::route('dashboard.team.index')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success')));