diff --git a/.github/workflows/monorepo-split.yml b/.github/workflows/monorepo-split.yml index a4c0e89..c682dca 100644 --- a/.github/workflows/monorepo-split.yml +++ b/.github/workflows/monorepo-split.yml @@ -8,10 +8,10 @@ jobs: provide-packages-list: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.3 coverage: none - uses: "ramsey/composer-install@v1" - id: packages-list @@ -27,7 +27,7 @@ jobs: matrix: package: ${{fromJson(needs.provide-packages-list.outputs.matrix)}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - id: previous-tag uses: "WyriHaximus/github-action-get-previous-tag@master" - name: Monorepo Split of ${{ matrix.package }} diff --git a/.github/workflows/monorepo-validate.yml b/.github/workflows/monorepo-validate.yml index 3c1b5ee..9107237 100644 --- a/.github/workflows/monorepo-validate.yml +++ b/.github/workflows/monorepo-validate.yml @@ -10,14 +10,14 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: composer-${{ hashFiles('composer.lock') }} - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 extensions: mbstring, pdo, pdo_sqlite coverage: none - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 314ea08..f5a600a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2, 8.1, 8.0] + php: [8.3, 8.2, 8.1, 8.0] laravel: [12.*, 11.*, 10.*, 9.*, 8.*] dependency-version: [prefer-lowest, prefer-stable] include: @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/.gitignore b/.gitignore index b30eb2e..9a6faec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .phpunit.result.cache .php-cs-fixer.cache composer.lock +.idea diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/blade.xml b/.idea/blade.xml new file mode 100644 index 0000000..1f94ea9 --- /dev/null +++ b/.idea/blade.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/laravel-idea.xml b/.idea/laravel-idea.xml new file mode 100644 index 0000000..af916f6 --- /dev/null +++ b/.idea/laravel-idea.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..28edbdf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..c7b9e2e --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml new file mode 100644 index 0000000..4f8104c --- /dev/null +++ b/.idea/phpunit.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/squire.iml b/.idea/squire.iml new file mode 100644 index 0000000..52d8734 --- /dev/null +++ b/.idea/squire.iml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 13d8448..f879427 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Common use cases for Squire include: - [Installing a Model](#installing-a-model) - [Using a Model](#using-a-model) - [Available Models](#available-models) + - [`Squire\Models\Aircraft`](#squiremodelsaircraft) - [`Squire\Models\Airline`](#squiremodelsairline) - [`Squire\Models\Airport`](#squiremodelsairport) - [`Squire\Models\Continent`](#squiremodelscontinent) @@ -64,6 +65,22 @@ Country::where('name', 'like', 'a%')->get(); // Get information about all countr ## Available Models +### `Squire\Models\Aircraft` + +#### Installation + +| Locale | Installation Command | +|--|-------------------------------------------| +| English | `composer require squirephp/aircrafts-en` | + +#### Schema + +| Column Name | Description | Example | +|--|--|--| +| `code_iata` | [IATA code](https://en.wikipedia.org/wiki/List_of_aircraft_type_designators) of the aircraft. | `77w` | +| `code_icao` | [ICAO code](https://en.wikipedia.org/wiki/List_of_aircraft_type_designators) of the aircraft. |`b77w` | +| `name` | Name of the aircraft. | `Boeing 777-300ER` | + ### `Squire\Models\Airline` #### Installation diff --git a/composer.json b/composer.json index 0759233..7c514ad 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,8 @@ "autoload": { "psr-4": { "Squire\\": [ + "packages/aircrafts-en/src", + "packages/aircrafts/src", "packages/airlines-en/src", "packages/airlines/src", "packages/airports-en/src", @@ -62,30 +64,32 @@ "extra": { "laravel": { "providers": [ - "Squire\\GbCountiesServiceProvider", - "Squire\\ContinentsEnServiceProvider", + "Squire\\AircraftsEnServiceProvider", + "Squire\\AircraftsServiceProvider", + "Squire\\AirlinesEnServiceProvider", + "Squire\\AirlinesServiceProvider", + "Squire\\AirportsEnServiceProvider", "Squire\\AirportsServiceProvider", + "Squire\\ContinentsDeServiceProvider", + "Squire\\ContinentsEnServiceProvider", + "Squire\\ContinentsPlServiceProvider", + "Squire\\ContinentsServiceProvider", "Squire\\CountriesDeServiceProvider", - "Squire\\AirlinesServiceProvider", - "Squire\\CountriesServiceProvider", - "Squire\\RegionsEnServiceProvider", - "Squire\\ModelServiceProvider", - "Squire\\GbCountiesEnServiceProvider", - "Squire\\AirlinesEnServiceProvider", "Squire\\CountriesEnServiceProvider", - "Squire\\ContinentsDeServiceProvider", - "Squire\\CountriesFrServiceProvider", "Squire\\CountriesEsServiceProvider", - "Squire\\TimezonesEnServiceProvider", + "Squire\\CountriesFrServiceProvider", "Squire\\CountriesPlServiceProvider", - "Squire\\TimezonesServiceProvider", - "Squire\\ContinentsServiceProvider", - "Squire\\AirportsEnServiceProvider", + "Squire\\CountriesServiceProvider", "Squire\\CurrenciesEnServiceProvider", - "Squire\\ContinentsPlServiceProvider", "Squire\\CurrenciesServiceProvider", + "Squire\\GbCountiesEnServiceProvider", + "Squire\\GbCountiesServiceProvider", + "Squire\\ModelServiceProvider", + "Squire\\RegionsEnServiceProvider", "Squire\\RegionsServiceProvider", - "Squire\\RepositoryServiceProvider" + "Squire\\RepositoryServiceProvider", + "Squire\\TimezonesEnServiceProvider", + "Squire\\TimezonesServiceProvider" ], "aliases": { "RepositoryManager": "Squire\\Repository\\Facades\\Repository" diff --git a/packages/aircrafts-en/composer.json b/packages/aircrafts-en/composer.json new file mode 100644 index 0000000..d276d8a --- /dev/null +++ b/packages/aircrafts-en/composer.json @@ -0,0 +1,41 @@ +{ + "name": "squirephp/aircrafts-en", + "description": "A library containing the English translation of Squire's Aircraft 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": "Mischa Sigtermans", + "email": "mischa@sigtermans.me" + } + ], + "require": { + "php": "^8.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", + "squirephp/aircrafts": "self.version", + "squirephp/repository": "self.version" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\AircraftsEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/packages/aircrafts-en/resources/data.csv b/packages/aircrafts-en/resources/data.csv new file mode 100644 index 0000000..ee97d07 --- /dev/null +++ b/packages/aircrafts-en/resources/data.csv @@ -0,0 +1,250 @@ +id,code_iata,code_icao,name +a124,a4f,a124,Antonov AN-124 Ruslan +a140,a40,a140,Antonov AN-140 +a225,a25,a225,Antonov An-225 Mriya +a306,aby,a306,Airbus A300-600 +a30b,ab3,a30b,Airbus A300 +a310,310,a310,Airbus A310 +a318,318,a318,Airbus A318 +a319,319,a319,Airbus A319 +a320,320,a320,Airbus A320 +a321,321,a321,Airbus A321 +a330,330,a330,Airbus A330 +a332,332,a332,Airbus A330-200 +a333,333,a333,Airbus A330-300 +a338,338,a338,Airbus A330-800 +a339,339,a339,Airbus A330-900 +a340,340,a340,Airbus A340 +a342,342,a342,Airbus A340-200 +a343,343,a343,Airbus A340-300 +a345,345,a345,Airbus A340-500 +a346,346,a346,Airbus A340-600 +a350,350,a350,Airbus A350 +a358,358,a358,Airbus A350-800 +a359,359,a359,Airbus A350-900 +a35k,351,a35k,Airbus A350-1000[2] +a388,380,a388,Airbus A380-800 +a3st,abb,a3st,Airbus A300-600ST Beluga Freighter +a748,hs7,a748,Hawker Siddeley HS 748 +ac68,acp,ac68,Gulfstream/Rockwell (Aero) Commander +ac90,act,ac90,Gulfstream/Rockwell (Aero) Turbo Commander +an12,anf,an12,Antonov AN-12 +an24,an4,an24,Antonov AN-24 +an26,a26,an26,Antonov AN-26 +an28,a28,an28,Antonov AN-28 +an30,a30,an30,Antonov AN-30 +an32,a32,an32,Antonov AN-32 +an72,an7,an72,Antonov AN-72 / AN-74 +as32,aph,as32,Eurocopter AS332 Super Puma +at43,at4,at43,Aerospatiale/Alenia ATR 42-300 / 320 +at45,at5,at45,Aerospatiale/Alenia ATR 42-500 +at46,atr,at46,Aerospatiale/Alenia ATR 42-600 +at72,at7,at72,Aerospatiale/Alenia ATR 72 +at73,atr,at73,Aerospatiale/Alenia ATR 72-200 series +at75,atr,at75,Aerospatiale/Alenia ATR 72-500 +at76,atr,at76,Aerospatiale/Alenia ATR 72-600 +atl,atl,atl,Robin ATL +atp,atp,atp,British Aerospace ATP +b105,mbh,b105,Eurocopter (MBB) Bo.105 +b190,beh,b190,Beechcraft 1900 +b212,bh2,b212,Bell 212 +b412,bh2,b412,Bell 412 +b429,bh2,b429,Bell 429 +b461,141,b461,BAe 146-100 +b462,142,b462,BAe 146-200 +b463,143,b463,BAe 146-300 +b703,703,b703,Boeing 707 +b712,717,b712,Boeing 717 +b720,b72,b720,Boeing 720B +b721,721,b721,Boeing 727-100 +b722,722,b722,Boeing 727-200 +b731,731,b731,Boeing 737-100 +b732,732,b732,Boeing 737-200 +b733,733,b733,Boeing 737-300 +b734,734,b734,Boeing 737-400 +b735,735,b735,Boeing 737-500 +b736,736,b736,Boeing 737-600 +b737,73g,b737,Boeing 737-700 +b738,738,b738,Boeing 737-800 +b739,739,b739,Boeing 737-900 +b741,741,b741,Boeing 747-100 +b742,742,b742,Boeing 747-200 +b743,743,b743,Boeing 747-300 +b744,744,b744,Boeing 747-400 +b748,748,b748,Boeing 747-8 +b74r,74r,b74r,Boeing 747SR +b74s,74l,b74s,Boeing 747SP +b752,752,b752,Boeing 757-200 +b753,753,b753,Boeing 757-300 +b762,762,b762,Boeing 767-200 +b763,763,b763,Boeing 767-300 +b764,764,b764,Boeing 767-400 +b772,772,b772,Boeing 777-200 / Boeing 777-200ER +b77l,77l,b77l,Boeing 777-200lr / Boeing 777F +b773,773,b773,Boeing 777-300 +b77w,77w,b77w,Boeing 777-300ER +b783,783,b783,Boeing 787-3[3] +b788,788,b788,Boeing 787-8[3] +b789,789,b789,Boeing 787-9[3] +b78j,78j,b78j,Boeing 787-10[4] +ba11,b11,ba11,British Aerospace (BAC) One Eleven +bcs1,cs1,bcs1,Bombardier CS100 +bcs3,cs3,bcs3,Bombardier CS300 +belf,shb,belf,Shorts SC-5 Belfast +blcf,74b,blcf,Boeing 747 LCF Dreamlifter +bn2p,bni,bn2p,Pilatus Britten-Norman BN-2A/B Islander +c130,loh,c130,Lockheed L-182 / 282 / 382 (L-100) Hercules +c162,cn1,c162,Cessna 162 +c172,cn1,c172,Cessna 172 +c72r,cn1,c72r,Cessna 172 Cutlass RG +c77r,cn1,c77r,Cessna 177 Cardinal RG +c182,cn1,c182,Cessna 182 Skylane +c208,cn1,c208,Cessna 208 Caravan +c210,cn1,c210,Cessna 210 Centurion +c212,cs2,c212,CASA / IPTN 212 Aviocar +c25a,cnj,c25a,Cessna Citation CJ2 +c25b,cnj,c25b,Cessna Citation CJ3 +c25c,cnj,c25c,Cessna Citation CJ4 +c46,cwc,c46,Curtiss C-46 Commando +c500,cnj,c500,Cessna Citation I +c510,cnj,c510,Cessna Citation Mustang +c525,cnj,c525,Cessna CitationJet +c550,cnj,c550,Cessna Citation II +c560,cnj,c560,Cessna Citation V +c56x,cnj,c56x,Cessna Citation Excel +c650,cnj,c650,Cessna Citation III +c680,cnj,c680,Cessna Citation Sovereign +c750,cnj,c750,Cessna Citation X +cl2t,,cl2t,Bombardier 415 +cl44,cl4,cl44,Canadair CL-44 +cl60,ccj,cl60,Canadair Challenger +cn35,cs5,cn35,CASA/IPTN CN-235 +conc,ssc,conc,Aerospatiale/BAC Concorde +coni,l49,coni,Lockheed L-1049 Super Constellation +couc,hec,couc,Helio H-250 Courier / H-295 / 385 Super Courier +crj1,cr1,crj1,Canadair Regional Jet 100 +crj2,cr2,crj2,Canadair Regional Jet 200 +crj7,cr7,crj7,Canadair Regional Jet 700 +crj9,cr9,crj9,Canadair Regional Jet 900 +crjx,crk,crjx,Canadair Regional Jet 1000 +cvlp,cv4,cvlp,Convair CV-240 & -440 +cvlt,cv5,cvlt,Convair CV-580 +d228,d28,d228,Fairchild Dornier Do.228 +d328,d38,d328,Fairchild Dornier Do.328 +dc10,d10,dc10,Douglas DC-10 +dc3,d3f,dc3,Douglas DC-3 +dc6,d6f,dc6,Douglas DC-6 +dc85,d8t,dc85,Douglas DC-8-50 +dc86,d8l,dc86,Douglas DC-8-62 +dc87,d8q,dc87,Douglas DC-8-72 +dc9,dc9,dc9,Douglas DC-9 +dc91,d91,dc91,Douglas DC-9-10 +dc92,d92,dc92,Douglas DC-9-20 +dc93,d93,dc93,Douglas DC-9-30 +dc94,d94,dc94,Douglas DC-9-40 +dc95,d95,dc95,Douglas DC-9-50 +dh2t,dhr,dh2t,De Havilland Canada DHC-2 Turbo-Beaver +dh8a,dh1,dh8a,De Havilland Canada DHC-8-100 Dash 8 / 8Q +dh8b,dh2,dh8b,De Havilland Canada DHC-8-200 Dash 8 / 8Q +dh8c,dh3,dh8c,De Havilland Canada DHC-8-300 Dash 8 / 8Q +dh8d,dh4,dh8d,De Havilland Canada DHC-8-400 Dash 8Q +dhc2,dhp,dhc2,De Havilland Canada DHC-2 Beaver +dhc3,dhl,dhc3,De Havilland Canada DHC-3 Otter +dhc4,dhc,dhc4,De Havilland Canada DHC-4 Caribou +dhc6,dht,dhc6,De Havilland Canada DHC-6 Twin Otter +dhc7,dh7,dhc7,De Havilland Canada DHC-7 Dash 7 +dove,dhd,dove,De Havilland DH.104 Dove +e110,emb,e110,Embraer EMB 110 Bandeirante +e120,em2,e120,Embraer EMB 120 Brasilia +e135,er3,e135,Embraer RJ135 +e145,er4,e145,Embraer RJ145 +e170,e70,e170,Embraer 170 +e175,e75,e175,Embraer 175 +e190,e90,e190,Embraer 190 +e190,e90,e190,Embraer 195 +e545,,e545,Embraer Legacy 450 +e135,er3,e135,Embraer Legacy 600 +e190,e90,e190,Embraer Lineage 1000 +e50p,ep1,e50p,Embraer Phenom 100 +e55p,ep3,e55p,Embraer Phenom 300 +ec25,,ec25,Eurocopter EC225 Super Puma +ec45,,ec45,Eurocopter EC145 +expl,md9,expl,MD Helicopters MD900 Explorer +f100,100,f100,Fokker 100 +f27,f27,f27,Fokker F27 Friendship +f28,f21,f28,Fokker F28 Fellowship +f2th,d20,f2th,Dassault Falcon 2000 +f50,f50,f50,Fokker 50 +f70,f70,f70,Fokker 70 +g159,grs,g159,Gulfstream Aerospace G-159 Gulfstream I +g21,grg,g21,Grumman G-21 Goose +g73t,grm,g73t,Grumman G-73 Turbo Mallard +glex,ccx,glex,Canadair Global Express +glf4,gj4,glf4,Gulfstream IV +glf5,gj5,glf5,Gulfstream V +glf6,gj6,glf6,Gulfstream G650 +hern,dhh,hern,De Havilland DH.114 Heron +h25b,h25,h25b,British Aerospace 125 series / Hawker/Raytheon 700/800/800xp/850/900 +h25c,h25,h25c,British Aerospace 125-1000 series / Hawker/Raytheon 1000 +i114,i14,i114,Ilyushin IL114 +il18,il8,il18,Ilyushin IL18 +il62,il6,il62,Ilyushin IL62 +il76,il7,il76,Ilyushin IL76 +il86,ilw,il86,Ilyushin IL86 +il96,i93,il96,Ilyushin IL96 +j328,frj,j328,Fairchild Dornier 328JET +js31,j31,js31,British Aerospace Jetstream 31 +js32,j32,js32,British Aerospace Jetstream 32 +js41,j41,js41,British Aerospace Jetstream 41 +ju52,ju5,ju52,Junkers Ju52/3M +l101,l10,l101,Lockheed L-1011 Tristar +l188,loe,l188,Lockheed L-188 Electra +l410,l4t,l410,LET 410 +load,alm,load,Ayres LM200 Loadmaster +md11,m11,md11,McDonnell Douglas MD-11 +md81,m81,md81,McDonnell Douglas MD-81 +md82,m82,md82,McDonnell Douglas MD-82 +md83,m83,md83,McDonnell Douglas MD-83 +md87,m87,md87,McDonnell Douglas MD-87 +md88,m88,md88,McDonnell Douglas MD-88 +md90,m90,md90,McDonnell Douglas MD-90 +mi8,mih,mi8,MIL Mi-8 / Mi-17 / Mi-171 / Mil-172 +mu2,mu2,mu2,Mitsubishi Mu-2 +n262,nd2,n262,Aerospatiale (Nord) 262 +noma,cd2,noma,Government Aircraft Factories N22B / N24A Nomad +p68,pn6,p68,Partenavia P.68 +pa31,pa2,pa31,Piper PA-31 Navajo +pa46,pag,pa46,Piper PA-46 +pc12,pl2,pc12,Pilatus PC-12 +pc6t,pl6,pc6t,Pilatus PC-6 Turbo Porter +rj1h,ar1,rj1h,Avro RJ100 +r200,,r200,Robin HR200/R2000 series / Alpha160A +rj70,ar7,rj70,Avro RJ70 +rj85,ar8,rj85,Avro RJ85 +rx1h,ax1,rx1h,Avro RJX100 +rx85,ax8,rx85,Avro RJX85 +s210,crv,s210,Aerospatiale (Sud Aviation) Se.210 Caravelle +s58t,s58,s58t,Sikorsky S-58T +s601,ndc,s601,Aerospatiale SN.601 Corvette +s61,s61,s61,Sikorsky S-61 +s65c,ndh,s65c,Eurocopter (Aerospatiale) SA365C / SA365N Dauphin 2 +s76,s76,s76,Sikorsky S-76 +s92,s92,s92,Sikorsky S-92 +sb20,s20,sb20,Saab 2000 +sc7,shs,sc7,Shorts SC-7 Skyvan +sf34,sf3,sf34,Saab SF340A/B +sh33,sh3,sh33,Shorts SD.330 +sh36,sh6,sh36,Shorts SD.360 +su95,,su95,Sukhoi Superjet 100 +t134,tu3,t134,Tupolev Tu-134 +t144,,t144,Tupolev Tu-144 +t154,tu5,t154,Tupolev Tu-154 +t204,t20,t204,Tupolev Tu-204 / Tu-214 +tb20,,tb20,Socata TB-20 Trinidad +tris,bnt,tris,Pilatus Britten-Norman BN-2A Mk III Trislander +visc,vcv,visc,Vickers Viscount +ww24,wwp,ww24,Israel Aircraft Industries 1124 Westwind +y12,yn2,y12,Harbin Yunshuji Y12 +yk40,yk4,yk40,Yakovlev Yak-40 +yk42,yk2,yk42,Yakovlev Yak-42 +ys11,ys1,ys11,NAMC YS-11 diff --git a/packages/aircrafts-en/src/AircraftsEnServiceProvider.php b/packages/aircrafts-en/src/AircraftsEnServiceProvider.php new file mode 100644 index 0000000..8b5927a --- /dev/null +++ b/packages/aircrafts-en/src/AircraftsEnServiceProvider.php @@ -0,0 +1,14 @@ + 'The selected :attribute is an invalid aircraft.', + +]; diff --git a/packages/aircrafts/src/AircraftsServiceProvider.php b/packages/aircrafts/src/AircraftsServiceProvider.php new file mode 100644 index 0000000..5d9aaf7 --- /dev/null +++ b/packages/aircrafts/src/AircraftsServiceProvider.php @@ -0,0 +1,17 @@ +loadTranslationsFrom(__DIR__ . '/../resources/lang', 'squire-aircrafts'); + + $this->publishes([ + __DIR__ . '/../resources/lang' => resource_path('lang/vendor/squire-aircrafts'), + ]); + } +} diff --git a/packages/aircrafts/src/Models/Aircraft.php b/packages/aircrafts/src/Models/Aircraft.php new file mode 100644 index 0000000..6d704cb --- /dev/null +++ b/packages/aircrafts/src/Models/Aircraft.php @@ -0,0 +1,16 @@ + 'string', + 'code_iata' => 'string', + 'code_icao' => 'string', + 'name' => 'string', + ]; +} diff --git a/packages/aircrafts/src/Rules/AircraftRule.php b/packages/aircrafts/src/Rules/AircraftRule.php new file mode 100644 index 0000000..9de4ab7 --- /dev/null +++ b/packages/aircrafts/src/Rules/AircraftRule.php @@ -0,0 +1,17 @@ +assertEquals(2, Models\Foo::count()); $this->assertEquals('bar', Models\Foo::first()->foo); + $this->testModel(Aircraft::class); $this->testModel(Airline::class); $this->testModel(Airport::class); $this->testModel(Continent::class); diff --git a/tests/RuleTest.php b/tests/RuleTest.php index 9b39788..bf7ecd9 100644 --- a/tests/RuleTest.php +++ b/tests/RuleTest.php @@ -4,6 +4,7 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Validator; +use Squire\Models\Aircraft; use Squire\Models\Airline; use Squire\Models\Airport; use Squire\Models\Continent; @@ -13,6 +14,7 @@ use Squire\Models\Region; use Squire\Models\Timezone; use Squire\Repository; +use Squire\Rules\AircraftRule; use Squire\Rules\AirlineRule; use Squire\Rules\AirportRule; use Squire\Rules\ContinentRule; @@ -31,6 +33,7 @@ public function can_be_validated(): void $this->testRule(Rules\FooRule::class, Models\Foo::class); + $this->testRule(AircraftRule::class, Aircraft::class); $this->testRule(AirlineRule::class, Airline::class); $this->testRule(AirportRule::class, Airport::class); $this->testRule(ContinentRule::class, Continent::class); diff --git a/tests/TestCase.php b/tests/TestCase.php index 6db0cb4..530c1f9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,8 @@ namespace Squire\Tests; +use Squire\AircraftsEnServiceProvider; +use Squire\AircraftsServiceProvider; use Squire\AirlinesEnServiceProvider; use Squire\AirlinesServiceProvider; use Squire\AirportsEnServiceProvider; @@ -29,6 +31,8 @@ class TestCase extends \Orchestra\Testbench\TestCase protected function getPackageProviders($app): array { return [ + AircraftsServiceProvider::class, + AircraftsEnServiceProvider::class, AirlinesServiceProvider::class, AirlinesEnServiceProvider::class, AirportsServiceProvider::class,