Пример #1
0
 /**
  * Show user data
  * @SWG\Get(
  *     path="/users/{user_id}",
  *     summary="Display user",
  *     @SWG\Parameter(ref="#/parameters/user_id"),
  *     @SWG\Response(response="default", ref="#/responses/User"),
  *     security={{"highcore_auth":{}}},
  * )
  * @param int $user_id  User Id
  * @return Response
  */
 public function show($user_id)
 {
     if ($user_id == 'me') {
         $user = $this->auth->user();
     } else {
         $user = User::find($user_id);
     }
     return $user;
 }
Пример #2
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }
Пример #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->delete();
     User::create(['email' => 'highcore', 'name' => 'highcore', 'password' => '$1$YPynwn8I$fsFMZlgDEira64ahGMpUI.']);
 }