本文整理汇总了PHP中UserRepository::store方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::store方法的具体用法?PHP UserRepository::store怎么用?PHP UserRepository::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserRepository
的用法示例。
在下文中一共展示了UserRepository::store方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postRegister
/**
* Handle the registration of user.
*
* @param type UserRegisterRequest $request
* @return type view
*/
public function postRegister(UserRegisterRequest $request, UserRepository $user_gestion)
{
if ($request->user_type == 1) {
if (is_null($request->siren)) {
$errors = new MessageBag(['siren' => [trans('validation.required', ['attribute' => trans('form.siren')])]]);
return Redirect::back()->withErrors($errors)->withInput(Input::except('siren'));
}
if (is_null($request->company_name)) {
$errors = new MessageBag(['company_name' => [trans('validation.required', ['attribute' => trans('form.company_name')])]]);
return Redirect::back()->withErrors($errors)->withInput(Input::except('company_name'));
}
}
$user_id = $user_gestion->store($request);
if ($request->user_type == 1) {
$company_gestion = new CompanyRepository(new Company());
$company_gestion->store($request, $user_id);
}
return Redirect::route('auth.register.success')->with('data_user', ['email' => $request->email, 'first_name' => $request->first_name, 'last_name' => $request->last_name]);
}