database/seeds/CountriesTableSeeder.php
/**
     * Run the database seeds.
     *
     * @throws Exception
     */
Run the database seeds.
@throws Exception
Run the database seeds . @throws Exception
public function run()
    {
        DB::table('countries')->delete();
        $countries = Config::get('countries');
        if (! $countries) {
            throw new Exception("Countries config file doesn't exists or empty, did you run: php artisan vendor:publish?");
        }
        foreach($countries as $country)
            DB::table('countries')->insert($country);
    }
public function run ( ) { DB :: table ( 'countries' ) -> delete ( ) ; $ countries = Config :: get ( 'countries' ) ; if ( ! $ countries ) { throw new Exception ( " Countries config file doesn't exists or empty, did you run: php artisan vendor:publish? " ) ; } foreach ( $ countries as $ country ) DB :: table ( 'countries' ) -> insert ( $ country ) ; }
Run the database seeds.
Run the database seeds .