本文整理匯總了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]);
}