Exemple #1
0
 public function show()
 {
     $id = Request::get('user_id');
     try {
         $user = User::findOrFail($id);
     } catch (ModelNotFoundException $exc) {
         return response(['ret' => 404, 'msg' => 'user not found.']);
     }
     return response(['ret' => 200, 'data' => $user->toArray()]);
 }
Exemple #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     \XinGroup\Model\User::create(['name' => 'admin', 'email' => '*****@*****.**', 'password' => Hash::make('admin'), 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]);
 }
Exemple #3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }