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


PHP UserRepository::save方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $tags = Tag::all();
     $skills = Skill::all();
     for ($i = 0; $i < 50; $i++) {
         $user = User::register($faker->unique()->userName, $faker->unique()->email, bcrypt('password'), 'talent');
         $this->userRepository->save($user);
         $profileData = ['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'location' => $faker->city, 'describe' => $faker->numberBetween(1, count($skills) - 1), 'about' => $faker->sentence(), 'facebook' => $faker->userName, 'linked_in' => $faker->userName, 'twitter' => $faker->userName, 'meetup' => $faker->userName, 'published' => $faker->boolean()];
         $userSkills = '';
         foreach (range(1, rand(2, 4)) as $x) {
             $id = rand(1, count($tags) - 1);
             $userSkills .= $tags[$id]->name . ",";
         }
         $profileData['skills'] = $userSkills;
         $this->dispatcher->dispatch(new UpdateProfile($user, $profileData));
     }
 }
开发者ID:katzumi,项目名称:talent4startups,代码行数:23,代码来源:UserTableSeeder.php

示例2: handle

 /**
  * Execute the job.
  *
  * @param UserRepository $repository
  * @return void
  */
 public function handle(UserRepository $repository)
 {
     $person = User::addHouseholdMember($this->firstname, $this->lastname, $this->middleinitial, $this->gender, $this->mobile_no, $this->email);
     $repository->save($person);
     $member = HouseholdMember::addMember($this->household_id, $person->id);
     $household = Household::findOrFail($this->household_id);
     $household->members()->save($member);
     event(new UserHasRegistered($person));
 }
开发者ID:ehomeuc,项目名称:ehome,代码行数:15,代码来源:AddNewHouseholdMemberJob.php

示例3: update

 /**
  * Show the form for editing the specified resource.
  *
  * @param int         $id
  * @param UserRequest $request
  *
  * @return Response
  */
 public function update($id, UserRequest $request)
 {
     $user = $this->userRepository->findByIdOrAbort($id);
     $user = UserUpdater::create($user, $request)->update();
     $this->userRepository->save($user);
     $eventDescription = trans('back.events.updated', ['model' => 'Gebruiker', 'name' => $user->email]);
     Activity::log($eventDescription);
     flash()->success(strip_tags($eventDescription));
     return redirect(URL::action('Back\\UserController@index', ['role' => $user->role]));
 }
开发者ID:bjrnblm,项目名称:blender,代码行数:18,代码来源:UserController.php

示例4: handle

 /**
  * Execute the command.
  *
  * @param Hasher $hasher
  * @param UserRepository $users
  * @return User
  * @throws UserAlreadyExistsException
  */
 public function handle(Hasher $hasher, UserRepository $users)
 {
     try {
         $users->findByEmail($this->email);
         throw new UserAlreadyExistsException($this->email);
     } catch (ModelNotFoundException $e) {
         $user = User::register($this->name, $this->email, $hasher->make($this->password), 'admin');
         $users->save($user);
         event(new UserWasRegistered($user));
         return $user;
     }
 }
开发者ID:manishkiozen,项目名称:Cms,代码行数:20,代码来源:RegisterAdministratorUserCommand.php

示例5: createUser

 /**
  * Extracts user data from request and sends it to the repository
  *
  * @param Request $request
  *
  * @return Response
  */
 public function createUser(Request $request)
 {
     return UserRepository::save($request->input('name'), $request->input('username'), $request->input('password'), $request->input('role'));
 }
开发者ID:Munk91,项目名称:Hovedopgave,代码行数:11,代码来源:UserController.php

示例6: handle

 /**
  * Execute the job.
  *
  * @param UserRepository $repository
  * @return void
  */
 public function handle(UserRepository $repository)
 {
     $user = User::registerHouseholdHead($this->firstname, $this->lastname, $this->middleinitial, $this->gender, $this->mobile_no, $this->email, $this->password);
     $repository->save($user);
     event(new UserHasRegistered($user));
 }
开发者ID:ehomeuc,项目名称:ehome,代码行数:12,代码来源:RegisterUserJob.php

示例7: handle

 /**
  * Execute the job.
  *
  * @param UserRepository $repository
  * @return void
  */
 public function handle(UserRepository $repository)
 {
     $person = User::updateHouseholdMember($this->user_id, $this->firstname, $this->lastname, $this->middleinitial, $this->gender, $this->mobile_no, $this->email);
     $repository->save($person);
 }
开发者ID:ehomeuc,项目名称:ehome,代码行数:11,代码来源:UpdateHouseholdMemberJob.php

示例8: handle

 /**
  * Execute the job.
  *
  * @param UserRepository $repository
  * @return void
  */
 public function handle(UserRepository $repository)
 {
     $user = $this->user->activateAccount();
     $repository->save($user);
 }
开发者ID:ehomeuc,项目名称:ehome,代码行数:11,代码来源:ActivateAccountJob.php


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