Exemple #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::table('users')->delete();
     $users = array(['name' => 'Ryan Chenkie', 'email' => '*****@*****.**', 'password' => Hash::make('secret')], ['name' => 'Chris Sevilleja', 'email' => '*****@*****.**', 'password' => Hash::make('secret')], ['name' => 'Holly Lloyd', 'email' => '*****@*****.**', 'password' => Hash::make('secret')], ['name' => 'Adnan Kukic', 'email' => '*****@*****.**', 'password' => Hash::make('secret')]);
     // Loop through each user above and create the record for them in the database
     foreach ($users as $user) {
         User::create($user);
     }
     Model::reguard();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::all();
     return $users;
 }
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'])]);
 }