public function run() { DB::table('zookeepers')->delete(); $faker = Faker\Factory::create('en_US'); for ($x = 0; $x < 3; $x++) { Zookeeper::create(['id' => $x + 1, 'name' => $faker->name]); } }
function getSublists() { $zookeepers = Zookeeper::orderBy("name", "ASC")->get(); $tab = []; foreach ($zookeepers as $zk) { $tab[$zk->id] = $zk->name; } return $tab; }