Exemple #1
0
 /**
  * Store a newly created User in storage.
  *
  * @param CreateUserRequest $request
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $input = $request->all();
     $user = $this->userRepository->create($input);
     Flash::success('User saved successfully.');
     return redirect(route('users.index'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateUserRequest|Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     //
     dd($request->all());
     User::create($request->all());
     return redirect('/');
 }
 public function postRegister(User $user, CreateUserRequest $request)
 {
     //code for registering a user goes here.
     $user->DoRegister($request->all());
     $this->auth->login($this->user);
     return redirect('/dashboard');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     $id = Auth::user()->id;
     if ($request->file('photo')) {
         $file = $request->file('photo');
         $name = 'Appmm_' . time() . '.' . $file->getClientOriginalExtension();
         // $path = public_path().'/upload/users/';
         // $file->move($path,$name);
         Storage::disk('users')->put($name, \File::get($file));
     }
     $users = new User($request->all());
     $users->iduser_create = $id;
     $users->photo = $name;
     $users->save();
     $profiles = new Profile();
     $profiles->user_id = $users->id;
     $profiles->save();
     Session::flash('message', 'El usuario ' . $users->name . '  Fue creado exitosamente');
     //guarda el valor de los campos enviados desde el form en un array
     $data = $request->all();
     //se envia el array y la vista lo recibe en llaves individuales {{ $email }} , {{ $subject }}...
     \Mail::send('emails.message', $data, function ($message) use($request) {
         //remitente
         $message->from($request->email, $request->name);
         //asunto
         $message->subject($request->name);
         //receptor
         $message->to(env('CONTACT_MAIL'), env('CONTACT_NAME'));
     });
     return redirect()->route('admin.usuarios.index');
 }
Exemple #5
0
 public function store(CreateUserRequest $request)
 {
     $user = new User($request->only(['name', 'email', 'role', 'password']));
     $user->save();
     session()->flash('success', 'El usuario se ha creado.');
     return redirect()->route('admin.user.edit', $user->id);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User($request->all());
     $user->type = $request->type;
     $user->save();
     return redirect()->route('admin.users.index');
 }
Exemple #7
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(\App\Http\Requests\CreateUserRequest $request)
 {
     $user = \App\Models\User::create($request->all());
     $user->password = bcrypt($user->password);
     $user->save();
     return redirect('users/' . $user->id);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = User::create($request->all());
     //return $redirect -> route('admin.users.index');
     //return \Redirect::route('admin.users.index');
     return redirect()->route('admin.users.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = User::create($request->all());
     $user_name_trim = str_replace(' ', '', $user->name);
     $username_rol = $user_name_trim . $user->id;
     $password = $user->password_hidden;
     $database = \Config::get('database.connections.mysql.database');
     $password_role = \DB::select("select password('{$password}') as password")[0]->password;
     /*
      * admin = all privileges.
      * user = insert,select and update.
      * sale = insert,select and update.
      * purchase = insert,select and update.
      * report = select.
      */
     if ($user->type == 'admin') {
         \DB::statement("CREATE USER '" . $username_rol . "'@'localhost' IDENTIFIED BY PASSWORD'" . $password_role . "'");
         \DB::statement("grant all privileges on {$database}.* to '" . $username_rol . "'@'localhost'");
         \DB::statement("FLUSH PRIVILEGES");
         Session::flash('message', $user->name . ' was registred !');
     }
     if ($user->type == 'user' || $user->type == 'purchase' || $user->type == 'sale') {
         \DB::statement("CREATE USER '" . $username_rol . "'@'localhost' IDENTIFIED BY PASSWORD'" . $password_role . "'");
         \DB::statement("grant select,insert,update on {$database}.* to '" . $username_rol . "'@'localhost'");
         \DB::statement("FLUSH PRIVILEGES");
         Session::flash('message', $user->name . ' was registred !');
     }
     if ($user->type == 'report') {
         \DB::statement("CREATE USER '" . $username_rol . "'@'localhost' IDENTIFIED BY PASSWORD'" . $password_role . "'");
         \DB::statement("grant select on {$database}.* to '" . $username_rol . "'@'localhost'");
         \DB::statement("FLUSH PRIVILEGES");
         Session::flash('message', $user->name . ' was registred !');
     }
     return redirect()->route('settings.users.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Route $route, CreateUserRequest $request)
 {
     $faker = Faker::create();
     $pass = '';
     $pass = $this->randomPassword();
     $users = new sw_usuario();
     $users->fill($request->all());
     $users->password = $pass;
     $users->usr_flag_pass = '******';
     $users->usr_creado_en = new DateTime();
     $users->usr_creado_por = Auth::user()->usr_name;
     $users->usr_modificado_en = new DateTime();
     $users->usr_modificado_por = Auth::user()->usr_name;
     $users->remember_token = $faker->sha256;
     $users->save();
     //dd($users);
     // $users = sw_usuario::create($request->all());
     //        $users = User::create($request->all());
     //        $User = new User();
     //        $User->fill($request->all());
     //        $user = sw_usuario::create($request->all());
     $emps = sw_empleado::leftjoin('sw_usuarios', 'sw_empleados.emp_an8', '=', 'sw_usuarios.usr_emp_an8')->select('sw_empleados.*', 'sw_usuarios.usr_emp_an8 as usr_emp_an8', 'sw_usuarios.usr_name', 'sw_usuarios.usr_id as usr_id', 'sw_usuarios.*')->findOrFail($request->usr_emp_an8);
     $this->sendMailCreate($pass, $emps);
     //
     Session::flash('message', 'El usuario ' . $emps->full_name . ' ' . ' Se ha creado en nuestros registros');
     return redirect()->route('admin.users.index');
 }
 /**
  * @param CreateUserRequest $request
  *
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(CreateUserRequest $request)
 {
     $user = $this->user->create($request->all());
     Flash::success(trans('admin/users/general.status.created'));
     // 'User successfully created');
     return redirect('/admin/users');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Requests\CreateUserRequest $request)
 {
     $this->user = new User($request->all());
     $password = bcrypt($request->password);
     $this->user->password = $password;
     $this->user->save();
     return redirect()->route('admin.users.index')->with('message', 'store');
 }
Exemple #13
0
 public function store(CreateUserRequest $Request)
 {
     $usr = $Request->all();
     $usr['password'] = Hash::make($usr['password']);
     $this->Response = User::ongMtu($usr);
     return redirect()->action('userController@ongeza')->with('successMsg', $this->Response);
     //$usr;//redirect()->action('userController@ongeza');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreateUserRequest $request)
 {
     $data = $request->except('password_confirmation');
     $data['password'] = bcrypt($data['password']);
     $data['uuid'] = Uuid::generate(4)->string;
     $user = User::create($data);
     return $this->response->item($user, new UserTransformer());
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     $new = new User();
     $new->name = $request->input('name');
     $new->email = $request->input('email');
     $new->password = bcrypt($request->input('new_password'));
     $new->save();
     return redirect('admin/user');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = User::create($request->all());
     $user->Stat()->create($request->all());
     //$id = $user->id;
     //$array= array('games' => 0, 'wins' => 0, 'loses' => 0, 'user_id' => $id);
     //$user_stats = UserStat::create($array);
     return redirect()->route('admin.users.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     //
     $user = \App\Models\User::create($request->all());
     // encrypt password
     $user->password = bcrypt($user->password);
     $user->save();
     return redirect('login')->with('message-success', 'You are now registered, please login');
 }
Exemple #18
0
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateUserRequest $request
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User();
     $user->fill($request->all());
     $user->save();
     $message = trans('messages.user_created_successfully');
     Flash::success($message);
     return redirect()->route('admin.users.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User($request->all());
     $new_password = uniqid();
     $new_username = $user['username'];
     $user['password'] = bcrypt($new_password);
     $user->save();
     return view('users.confirmation', compact('new_username', 'new_password'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     if ($request->all()) {
         User::create(['user_name' => Input::get('user_name'), 'email_address' => Input::get('email_address'), 'password' => Hash::make(Input::get('password')), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'gender' => intval(Input::get('gender')), 'country' => Input::get('country'), 'birth_date' => date('y-m-d', strtotime(Input::get('birth_date')))]);
         $request->session()->put('user', User::where('email_address', Input::get('email_address'))->first()->toArray());
         return redirect('user');
     }
     dd("ALALALH!@");
 }
 /**
  *
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User();
     $user->fill($request->all());
     $user->company_id = Auth::user()->company_id;
     $user->password = bcrypt($request->input('password'));
     $user->save();
     Flash::success(trans('users/general.status.created'));
     return redirect('/users');
 }
 /**
  * Store a newly created user in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User($request->all());
     $user->password = \Hash::make($request->password);
     $user->type = 'user';
     $user->save();
     \Auth::login($user);
     \Session::put('auth_photo', '../default_avatar.jpg');
     return redirect()->route('newaccount');
 }
Exemple #23
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $user = User::create(['username' => $request->input('username'), 'password' => bcrypt($request->input('password'))]);
     if ($user) {
         flash()->success('Admin created successfully!');
     } else {
         flash()->error('Oops! Something went wrong.');
     }
     return redirect(route('backend'));
 }
 /**
  * @param CreateUserRequest $request
  *
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(CreateUserRequest $request)
 {
     $user = $this->userRepository->model->create($request->all());
     if ($request->get('role')) {
         $user->roles()->sync($request->get('role'));
     } else {
         $user->roles()->sync([]);
     }
     return redirect()->action('Backend\\UsersController@index')->with('sucess', 'User successfully created');
 }
 /**
  * @param CreateUserRequest $request
  *
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(CreateUserRequest $request)
 {
     $user = $this->user->create($request->all());
     if ($request->get('role')) {
         $user->roles()->sync($request->get('role'));
     } else {
         $user->roles()->sync([]);
     }
     Flash::success('User successfully created');
     return redirect('/users');
 }
 /**
  * Store a newly created User in storage.
  *
  * @param CreateUserRequest $request
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     $input = $request->all();
     $input['objectId'] = str_random(10);
     $input['password'] = bcrypt($input['password']);
     if ($request->file('image')) {
         $input['profileimage'] = json_encode($this->uploadImage($request->file('profileimage'), '/posts_photo/'));
     }
     $user = $this->userRepository->create($input);
     Flash::success('User saved successfully.');
     return redirect(route('users.index'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     if ($request->all()) {
         $aUser = User::create(['user_name' => Input::get('user_name'), 'email_address' => Input::get('email_address'), 'password' => Hash::make(Input::get('password')), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'gender' => intval(Input::get('gender')), 'country' => Input::get('country'), 'birth_date' => date('y-m-d', strtotime(Input::get('birth_date'))), 'avatar' => Photo::PHOTO_LINK_AVATAR_USER_DEFAULT]);
         $aCharacter = Character::create(['user_id' => $aUser['id'], 'families_id' => 1, 'character_name' => $aUser['user_name'], 'character_age' => 1, 'character_avatar' => Photo::PHOTO_LINK_AVATAR_CHARACTER_NORMAL_DEFAULT, 'character_avatar_mini' => Photo::PHOTO_LINK_AVATAR_CHARACTER_MINI_DEFAULT]);
         $aUser->update(['current_character_id' => $aCharacter['id']]);
         $request->session()->put('user', User::where('email_address', Input::get('email_address'))->first()->toArray());
         UserSetting::create(['user_id' => User::where('email_address', Input::get('email_address'))->first()->toArray()['id']]);
         return redirect('user/profile');
     }
     dd("ALALALH!@");
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateUserRequest $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(CreateUserRequest $request)
 {
     $user = new User();
     $user->fill($request->all());
     $user->save();
     $message = trans('UserManagement::messages.users.store');
     if ($request->ajax()) {
         return $message;
     }
     //\Flash::success($message);
     return redirect()->route('admin.users.index');
 }
 public function newUser(CreateUserRequest $request)
 {
     $input = $request->all();
     User::create($input);
     if (Session::get('errors') == "") {
         $errorCode = 0;
         $errorMessage = null;
     }
     \Session::flash('key', $input['_token']);
     $id = User::get()->where('UserName', $input['UserName'])->where('Password', $input['Password']);
     $showId = last(array_flatten($id))['id'];
     return $array = ['ErrorCode' => $errorCode, 'ErrorMessage' => $errorMessage, 'Data' => ['UserId' => $showId, 'SessionId' => Session::get('key'), 'UserName' => $input['UserName']]];
 }
Exemple #30
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     //
     $user = new User();
     $user->username = $request->username;
     $user->password = $request->password;
     $user->admin = $request->has('is_admin') ? $request->is_admin : 0;
     if ($user->save()) {
         return redirect()->route('console::users::index')->with('alert', ['type' => 'success', 'message' => 'User added.']);
     } else {
         return redirect()->route('console::users::create')->with('alert', ['type' => 'failure', 'message' => 'An error occurred, and the user could not be added.']);
     }
 }