Sentinel::RegisterAndActivate()
//Register the $request user and activate if(Sentinel::registerAndActivate($request->All())){ //Search the new registered user $user = User::whereEmail($request->get('email'))->firstOrFail(); //Bind the user to Activation Table $activation=Activation::create($userSentinel); //Assign A Profile To The New Registered User $userProfile = new Profile(); $userProfile->user_id = $user->id; $userProfile->smoked = $request->smoked; $userProfile->lat = 0.0; $userProfile->lng = 0.0; $user->profile()->save($userProfile); //Find role $role=Sentinel::findRoleBySlug('member')->firstOrFail(); //Attach the user to the Role $role->users()->attach($user); return redirect()->back()->with('status','Registration Successful !'); }else{ return redirect()->back()->with('error','Registration Failed !'); //return back()->withErrors($validator); }
Sentinel::Register()
if($userSentinel = Sentinel::register($request->All())){ //Search the new registered user $user = User::whereEmail($request->get('email'))->firstOrFail(); //Bind the user to Activation Table $activation=Activation::create($userSentinel); //Assign A Profile To The New Registered User $userProfile = new Profile(); $userProfile->user_id = $user->id; $userProfile->smoked = $request->smoked; $userProfile->lat = 0.0; $userProfile->lng = 0.0; $user->profile()->save($userProfile); //Find role $role=Sentinel::findRoleBySlug('member')->firstOrFail(); //Attach the user to the Role $role->users()->attach($user); return redirect()->back()->with('status','Registration Successful !'); }else{ return redirect()->back()->with('error','Registration Failed !'); //return back()->withErrors($validator); }
Leave a Reply