July 2018
Intermediate to advanced
420 pages
8h 46m
English
Remember that, in the last chapter, we already created the Bike seed, so now we just need to create another three seeds, which are going to be Builders, Items, and Garage.
php artisan make:seeder BuildersTableSeeder
DB::table('builders')->delete();$json = File::get("database/data-sample/builders.json");$data = json_decode($json);foreach ($data as $obj) { Builder::create(array( 'id' => $obj->id, 'name' => $obj->name, 'description' => $obj->description, 'location' => $obj->location ));}php artisan make:seeder ...