Start working on the invite system for users
This commit is contained in:
@@ -62,6 +62,17 @@ class TeamController extends Controller
|
||||
->withPageTitle(trans('dashboard.team.add.title').' - '.trans('dashboard.dashboard'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the invite team member view.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showInviteTeamMemberView()
|
||||
{
|
||||
return View::make('dashboard.team.invite')
|
||||
->withPageTitle(trans('dashboard.team.invite.title').' - '.trans('dashboard.dashboard'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new team member.
|
||||
*
|
||||
@@ -111,6 +122,28 @@ class TeamController extends Controller
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new team member.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function postInviteUser()
|
||||
{
|
||||
try {
|
||||
$this->dispatch(new InviteTeamMemberCommand(
|
||||
array_unique(array_filter((array) Binput::get('emails')))
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.team.invite')
|
||||
->withInput(Binput::except('password'))
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.team.invite')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.invite.success')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a user.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user