Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- <?php
- use Illuminate\Database\Seeder;
- use App\User;
- class UserTableSeeder extends Seeder {
- public function run()
- {
- DB::table('users')->delete();
- $json = File::get("database/data/users.json");
- $data = json_decode($json);
- foreach ($data as $obj) {
- User::create(array(
- 'id' => $obj->id,
- 'email' => $obj->email,
- 'first_name' => $obj->first_name,
- 'last_name' => $obj->last_name,
- 'password' => $obj->password
- ));
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement