Skip to content

Instantly share code, notes, and snippets.

@antonkomarev
Last active January 19, 2017 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonkomarev/d8b069df8a37eb771f0d261d374137a5 to your computer and use it in GitHub Desktop.
Save antonkomarev/d8b069df8a37eb771f0d261d374137a5 to your computer and use it in GitHub Desktop.
Laravel dictionary seeders
<?php
use Illuminate\Database\Seeder;
class CountrySeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$countries = File::get('database/dictionaries/country.json');
$countries = json_decode($countries, true);
foreach ($countries as $country) {
\Cog\Geo\Models\Country::create($country);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment