Skip to content

Instantly share code, notes, and snippets.

@brandonsueur
Created October 18, 2019 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonsueur/3773ff19c516260cb1dfd126b6050498 to your computer and use it in GitHub Desktop.
Save brandonsueur/3773ff19c516260cb1dfd126b6050498 to your computer and use it in GitHub Desktop.
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