Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
r->email = $request->email;
if(Auth::user()->role === 'super-admin'){
$user->user_type = $request->user_type;
} elseif(Auth::user()->user_type === 'hospital'){
$user->user_type = 'hospital';
$user->service_id = $request->service ?? null;
} elseif(Auth::user()->user_type === 'carrier'){
$user->user_type = 'carrier';
} elseif(Auth::user()->user_type === 'gesnord') {
$user->user_type = 'gesnord';
}
$user->role = $request->role;
$user->job = $request->job ?? null;
$user->institution_id = $request->institution ?? null;
$user->company_id = $request->company ?? null;
$user->event_report = isset($data['event_report']) ? true : false;
$user->verified = true;
$user->password = Hash::make($request->password);
$user->save();
\LogActivity::addToLog("user($user->user_type):created");
return redirect()
->action('UsersController@show')
->with('stat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.