Last active
January 19, 2017 09:21
-
-
Save antonkomarev/d8b069df8a37eb771f0d261d374137a5 to your computer and use it in GitHub Desktop.
Laravel dictionary seeders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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