本文整理汇总了PHP中Illuminate\Contracts\Bus\Dispatcher::dispatchFrom方法的典型用法代码示例。如果您正苦于以下问题:PHP Dispatcher::dispatchFrom方法的具体用法?PHP Dispatcher::dispatchFrom怎么用?PHP Dispatcher::dispatchFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Bus\Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::dispatchFrom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
/**
* Unfallow a User
*
* @param $userIdToUnfallow
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($userIdToUnfallow, Request $request)
{
$request->replace(array_add($request->all(), 'userId', Auth::id()));
$this->dispatcher->dispatchFrom(UnfallowUser::class, $request);
Flash::success('You have now unfallowed this user');
return Redirect::back();
}
示例2: store
/**
* @param Requests\SignUpRequest $request
* @param CommandDispatcher $commandDispatcher
*
* @return
*/
public function store(Requests\SignUpRequest $request, CommandDispatcher $commandDispatcher)
{
$commandDispatcher->dispatchFrom(RegisterUser::class, $request);
\Auth::login(User::where('username', $request['username'])->first());
Flash::overlay('Welcome!!');
return Redirect::home();
}
示例3: store
/**
* Leave a comment
*
* @param Request $request
* @param Dispatcher $dispatcher
* @return Response
*/
public function store(Request $request, Dispatcher $dispatcher)
{
$request->replace(array_add($request->all(), 'user_id', \Auth::id()));
$dispatcher->dispatchFrom(LeaveCommentOnStatus::class, $request);
return \Redirect::back();
}
示例4: reset
/**
* Reset the user password.
*
* @author Andrea Marco Sartori
* @return Illuminate\Http\RedirectResponse
*/
public function reset(ResetRequest $request, $token)
{
$this->bus->dispatchFrom('Cerbero\\Auth\\Commands\\ResetCommand', $request, compact('token'));
return redirect()->route('login.index')->withSuccess(trans('auth::reset.success'));
}