Skip to content

Commit

Permalink
Refactor seed naming system (#16)
Browse files Browse the repository at this point in the history
* refactor seed naming system

* update changelog file
  • Loading branch information
lwwcas authored Apr 14, 2023
1 parent bd11edf commit f7c5a17
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 315 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to `laravel-countries` will be documented in this file

## 3.4.5 - 2023-14-04

- Refactor all seed naming system
## 3.4.4 - 2023-14-04

- Adding German language to country data and its translations
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"Lwwcas\\LaravelCountries\\Casts\\": "src/casts",
"Lwwcas\\LaravelCountries\\Database\\": "src/database",
"Lwwcas\\LaravelCountries\\Database\\Seeders\\": "src/database/seeders",
"Lwwcas\\LaravelCountries\\Database\\Seeders\\Countries\\": "src/database/seeders/countries"
"Lwwcas\\LaravelCountries\\Database\\Seeders\\Countries\\": "src/database/seeders/countries",
"Lwwcas\\LaravelCountries\\Database\\Seeders\\Languages\\": "src/database/seeders/languages"
}
},
"autoload-dev": {
Expand Down
32 changes: 32 additions & 0 deletions src/database/seeders/LanguagesSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Lwwcas\LaravelCountries\Database\Seeders;

use Illuminate\Database\Seeder;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\ArabicLanguageSeeder as Arabic;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\DutchLanguageSeeder as Dutch;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\FrenchLanguageSeeder as French;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\GermanLanguageSeeder as German;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\ItalianLanguageSeeder as Italian;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\PortugueseLanguageSeeder as Portuguese;
use Lwwcas\LaravelCountries\Database\Seeders\Languages\SpanishLanguageSeeder as Spanish;

class LanguagesSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// Add all countries translations
$this->call(Portuguese::class);
$this->call(Spanish::class);
$this->call(French::class);
$this->call(Italian::class);
$this->call(Arabic::class);
$this->call(Dutch::class);
$this->call(German::class);
}
}
10 changes: 2 additions & 8 deletions src/database/seeders/LcDatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,7 @@ public function run()
$this->call(\Lwwcas\LaravelCountries\Database\Seeders\Countries\ZM_Zambia::class);
$this->call(\Lwwcas\LaravelCountries\Database\Seeders\Countries\ZW_Zimbabwe::class);

// Add all countries translations
$this->call(PtSeeder::class);
$this->call(EsSeeder::class);
$this->call(FrSeeder::class);
$this->call(ItSeeder::class);
$this->call(ArSeeder::class);
$this->call(NlSeeder::class);
$this->call(GermanLanguageSeeder::class);
// All countries translations
$this->call(LanguagesSeeder::class);
}
}
295 changes: 0 additions & 295 deletions src/database/seeders/NlSeeder.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace Lwwcas\LaravelCountries\Database\Seeders;
namespace Lwwcas\LaravelCountries\Database\Seeders\Languages;

use Illuminate\Database\Seeder;
use Lwwcas\LaravelCountries\Database\Seeders\Builder;

class ArSeeder extends Seeder
class ArabicLanguageSeeder extends Seeder
{

/**
Expand Down
Loading

0 comments on commit f7c5a17

Please sign in to comment.