Skip to content

Commit

Permalink
add continents-de package
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstark999 committed Mar 25, 2021
1 parent 736e382 commit 35fc64c
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"packages/airlines/src",
"packages/airports-en/src",
"packages/airports/src",
"packages/continents-de/src",
"packages/continents-en/src",
"packages/continents/src",
"packages/countries-de/src",
Expand Down Expand Up @@ -52,7 +53,7 @@
"laravel": {
"providers": [
"Squire\\GbCountiesServiceProvider",
"Squire\\ContinentsEnServiceProvider",
"ContinentsDeServiceProvider",
"Squire\\AirportsServiceProvider",
"Squire\\CountriesDeServiceProvider",
"Squire\\AirlinesServiceProvider",
Expand Down
39 changes: 39 additions & 0 deletions packages/continents-de/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "squirephp/continents-de",
"description": "A library containing the German translation of Squire's Continent model.",
"keywords": ["squire"],
"license": "MIT",
"homepage": "https://github.com/squirephp",
"support": {
"issues": "https://github.com/squirephp/squire/issues",
"source": "https://github.com/squirephp/squire"
},
"authors": [
{
"name": "Dan Harrin",
"email": "[email protected]"
}
],
"require": {
"php": "^7.2|^8.0",
"illuminate/support": "^6.0 || ^7.0 || ^8.0",
"squirephp/continents": "^2.0",
"squirephp/repository": "^2.0"
},
"autoload": {
"psr-4": {
"Squire\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"Squire\\ContinentsDeServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
8 changes: 8 additions & 0 deletions packages/continents-de/resources/data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id,code,name
af,af,Afrika
an,an,Antarktis
as,as,Asien
eu,eu,Europa
na,na,Nordamerika
oc,oc,Ozeanien
sa,sa,Südamerika
14 changes: 14 additions & 0 deletions packages/continents-de/src/ContinentsDeServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Squire;

use Illuminate\Support\ServiceProvider;
use Squire\Models\Continent;

class ContinentsDeServiceProvider extends ServiceProvider
{
public function boot()
{
Repository::registerSource(Continent::class, 'de', __DIR__.'/../resources/data.csv');
}
}
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ protected function getPackageProviders($app): array
\Squire\AirportsServiceProvider::class,
\Squire\AirportsEnServiceProvider::class,
\Squire\ContinentsServiceProvider::class,
\Squire\ContinentsDeServiceProvider::class,
\Squire\ContinentsEnServiceProvider::class,
\Squire\CountriesServiceProvider::class,
\Squire\CountriesDeServiceProvider::class,
Expand All @@ -27,4 +28,4 @@ protected function getPackageProviders($app): array
\Squire\RepositoryServiceProvider::class,
];
}
}
}

0 comments on commit 35fc64c

Please sign in to comment.