当前位置: 首页>>代码示例>>PHP>>正文


PHP User::fill方法代码示例

本文整理汇总了PHP中app\User::fill方法的典型用法代码示例。如果您正苦于以下问题:PHP User::fill方法的具体用法?PHP User::fill怎么用?PHP User::fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\User的用法示例。


在下文中一共展示了User::fill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postProfile

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postProfile(Request $request)
 {
     $inputs = $request->only('name', 'email');
     $validator = $this->validatorForProfile($inputs);
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     if ($this->user->fill($inputs)->save()) {
         session()->flash('success', 'Your profile is updated.');
         return redirect('dashboard');
     }
     session()->flash('error', 'Error occured to update your profile!');
     return back();
 }
开发者ID:GreenHackers,项目名称:election-website,代码行数:20,代码来源:ProfileController.php

示例2: store

 public function store($request)
 {
     $user = new User();
     $user->fill($request);
     $user->save();
     return $user;
 }
开发者ID:edsonalvesan,项目名称:appodonto,代码行数:7,代码来源:UserRepository.php

示例3: register

 public static function register(array $data)
 {
     // Fake when saving data
     $user = new User();
     $user->fill(['name' => trim($data['name']), 'email' => filter_var($data['email'], FILTER_SANITIZE_EMAIL), 'password' => $data['password']]);
     return $user;
 }
开发者ID:rifkyekayama,项目名称:laravel-5.1-broadcast-example,代码行数:7,代码来源:User.php

示例4: update

 /**
  * Update the specified user in storage.
  *
  * @param User $user
  * @param UserRequest $request
  * @return Response
  */
 public function update(User $user, UserRequest $request)
 {
     $data = $this->storeImage($request, 'picture');
     $user->fill($data);
     $user->save() == true ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail'));
     return redirect(route('admin.user.index'));
 }
开发者ID:abada,项目名称:laravel-5-simple-cms,代码行数:14,代码来源:UserController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, City $city, User $user)
 {
     $this->validate($request, ['name_first' => 'required', 'name_last' => 'required', 'username' => 'required', 'bio' => 'required', 'email' => 'required|unique:users,id,' . $request->get('id')]);
     $user->fill(Input::all());
     $user->resluggify();
     $user->save();
     return Redirect::route('{city}.users.index', $city->iata)->with('message', 'User updated');
 }
开发者ID:EMT,项目名称:see-do,代码行数:15,代码来源:UsersController.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->delete();
     //add admin
     $user = new User();
     $user->fill(array('name' => 'admin', 'email' => 'admin@admin.com', 'password' => bcrypt('admin'), 'role' => 'admin', 'active' => 1));
     $user->save();
 }
开发者ID:spwin,项目名称:controlmystock,代码行数:13,代码来源:UsersSeeder.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['email' => 'required|email', 'password' => 'required|confirmed']);
     $user = new User();
     $user->fill($request->only(['email', 'is_admin']));
     $user->password = Hash::make($request->get('password'));
     $user->save();
     return redirect()->route('users.index')->with('flash', ['level' => 'success', 'message' => 'Added "' . $user->email . '".']);
 }
开发者ID:jasonmccreary,项目名称:courses.e-hazard.com,代码行数:14,代码来源:UsersController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|unique:users|max:255', 'email' => 'required|email']);
     $input = Input::all();
     $user = new User();
     $user->fill($input);
     $user->save();
     return json_encode(array('id' => $user->id, 'name' => $user->name, 'email' => $user->email));
 }
开发者ID:binaryvo,项目名称:mapp,代码行数:15,代码来源:UserController.php

示例9: store

 /**
  * 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');
 }
开发者ID:jrafaelca,项目名称:infrea,代码行数:15,代码来源:UsersController.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $user = new User();
     $user->fill($request->all());
     $user->save();
     $user->attachRoles(Input::get('rol'));
     Flash::success('Usuario creado......');
     return redirect()->route('user.create');
 }
开发者ID:michini,项目名称:proyecto,代码行数:15,代码来源:UserController.php

示例11: createUser

 public function createUser()
 {
     $input = Input::all();
     $input['password'] = Hash::make($input['password']);
     $user = new User();
     $user->fill($input);
     $user->save();
     return $user;
 }
开发者ID:gospodin-binev,项目名称:RestApi,代码行数:9,代码来源:User.php

示例12: postSignup

 public function postSignup(Request $request)
 {
     $this->validate($request, ['username' => 'required|unique:users', 'email' => 'required|unique:users', 'password' => 'required|min:6']);
     $user = new User();
     $user->fill($request->all());
     $user->password = Hash::make($request->input('password'));
     $user->save();
     Auth::login($user);
     return redirect()->to('/');
 }
开发者ID:enhive,项目名称:vev,代码行数:10,代码来源:AuthController.php

示例13: store

 protected function store(CreateUserRequest $request)
 {
     $user = new User();
     $user->fill($request->all());
     if ($user->save()) {
         return redirect('/user')->with('success', 'User created succssfully');
     } else {
         return redirect('/user')->with('error', trans('translate.A Problem occured, Please try again later!'));
     }
 }
开发者ID:wellbornman,项目名称:laravel-dev,代码行数:10,代码来源:UserController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(MaestroRequest $request)
 {
     $tipo = Tipo::byName('Maestro');
     $maestro = new User();
     $maestro->fill($request->all());
     $maestro->password = \Hash::make($request->input('password'));
     $maestro->tipo_id = $tipo->id;
     $maestro->estatus_id = 0;
     $maestro->save();
     return redirect()->route('admin.maestro.index');
 }
开发者ID:ericray,项目名称:test,代码行数:17,代码来源:MaestroController.php

示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $params = $request->all();
     $user = new User();
     $params['password'] = bcrypt($params['password']);
     $user->fill($params);
     if ($user->save()) {
         return redirect()->back()->with('success_message', 'USuario agregado con exito');
     }
     return redirect()->back()->with('error_message', 'Error al insertar el usuario, intente de nuevo');
 }
开发者ID:OscarSith,项目名称:sistema,代码行数:17,代码来源:UsersController.php


注:本文中的app\User::fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。