From e15f264af4228e631cf6719838a5e5d225de984a Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Sat, 9 Jan 2021 21:54:22 +0000 Subject: [PATCH] wip --- README.md | 16 +- composer.json | 30 +++ data/countries.csv | 250 ------------------ packages/airlines-en/composer.json | 39 +++ .../airlines-en/data.csv | 0 .../src/AirlinesEnServiceProvider.php | 15 ++ packages/airlines/composer.json | 30 +++ packages/airlines/src/Models/Airline.php | 18 ++ packages/airports-en/composer.json | 39 +++ .../airports-en/data.csv | 0 .../src/AirportsEnServiceProvider.php | 15 ++ packages/airports/composer.json | 30 +++ packages/airports/src/Models/Airport.php | 18 ++ packages/continents-en/composer.json | 39 +++ .../continents-en/data.csv | 0 .../src/ContinentsEnServiceProvider.php | 15 ++ packages/continents/composer.json | 30 +++ packages/continents/src/Models/Continent.php | 18 ++ packages/currencies-en/composer.json | 39 +++ .../currencies-en/data.csv | 0 .../src/CurrenciesEnServiceProvider.php | 15 ++ packages/currencies/composer.json | 30 +++ packages/currencies/src/Models/Currency.php | 13 + packages/gb-counties-en/composer.json | 39 +++ .../gb-counties-en/data.csv | 0 .../src/GbCountiesEnServiceProvider.php | 15 ++ packages/gb-counties/composer.json | 30 +++ packages/gb-counties/src/Models/GbCounty.php | 13 + packages/regions-en/composer.json | 39 +++ .../regions-en/data.csv | 0 .../src/RegionsEnServiceProvider.php | 15 ++ packages/regions/composer.json | 30 +++ packages/regions/src/Models/Region.php | 28 ++ 33 files changed, 650 insertions(+), 258 deletions(-) delete mode 100644 data/countries.csv create mode 100644 packages/airlines-en/composer.json rename data/airlines.csv => packages/airlines-en/data.csv (100%) create mode 100644 packages/airlines-en/src/AirlinesEnServiceProvider.php create mode 100644 packages/airlines/composer.json create mode 100644 packages/airlines/src/Models/Airline.php create mode 100644 packages/airports-en/composer.json rename data/airports.csv => packages/airports-en/data.csv (100%) create mode 100644 packages/airports-en/src/AirportsEnServiceProvider.php create mode 100644 packages/airports/composer.json create mode 100644 packages/airports/src/Models/Airport.php create mode 100644 packages/continents-en/composer.json rename data/continents.csv => packages/continents-en/data.csv (100%) create mode 100644 packages/continents-en/src/ContinentsEnServiceProvider.php create mode 100644 packages/continents/composer.json create mode 100644 packages/continents/src/Models/Continent.php create mode 100644 packages/currencies-en/composer.json rename data/currencies.csv => packages/currencies-en/data.csv (100%) create mode 100644 packages/currencies-en/src/CurrenciesEnServiceProvider.php create mode 100644 packages/currencies/composer.json create mode 100644 packages/currencies/src/Models/Currency.php create mode 100644 packages/gb-counties-en/composer.json rename data/counties/gb.csv => packages/gb-counties-en/data.csv (100%) create mode 100644 packages/gb-counties-en/src/GbCountiesEnServiceProvider.php create mode 100644 packages/gb-counties/composer.json create mode 100644 packages/gb-counties/src/Models/GbCounty.php create mode 100644 packages/regions-en/composer.json rename data/regions.csv => packages/regions-en/data.csv (100%) create mode 100644 packages/regions-en/src/RegionsEnServiceProvider.php create mode 100644 packages/regions/composer.json create mode 100644 packages/regions/src/Models/Region.php diff --git a/README.md b/README.md index 2942dba..998f186 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ No additional setup is required. You can interact with a Squire model just like you would any other Eloquent model, except that it only handles read-only operations. ```php -use Squire\Models\Country; +use Squire\Models\Airline; -Country::all(); // Get information about all countries. +Airline::all(); // Get information about all countries. -Country::find('us'); // Get information about the United States. +Airline::find('us'); // Get information about the United States. -Country::where('name', 'like', 'a%')->get(); // Get information about all countries beginning with the letter "a". +Airline::where('name', 'like', 'a%')->get(); // Get information about all countries beginning with the letter "a". ``` ## Available models @@ -174,7 +174,7 @@ The simplest option is to create a new model in your app, and let it extend the namespace App\Models; -use Squire\Models\Country as SquireCountry; +use Squire\Models\Airline as SquireCountry; class Country extends SquireCountry { @@ -193,9 +193,9 @@ Another option is the `resolveRelationUsing()` method. This allows you to dynami ```php use App\Models\User; -use Squire\Models\Country; +use Squire\Models\Airline; -Country::resolveRelationUsing('users', function (Country $country) { +Airline::resolveRelationUsing('users', function (Airline $country) { return $country->hasMany(User::class); }); ``` @@ -211,7 +211,7 @@ Create a new model within your app and let it extend the Squire model that you w namespace App\Models; -use Squire\Models\Country as SquireCountry; +use Squire\Models\Airline as SquireCountry; class Country extends SquireCountry { diff --git a/composer.json b/composer.json index e4ca760..8b93977 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,21 @@ "autoload": { "psr-4": { "Squire\\": [ + "packages/airlines-en/src", + "packages/airlines/src", + "packages/airports-en/src", + "packages/airports/src", + "packages/continents-en/src", + "packages/continents/src", "packages/countries-en/src", "packages/countries/src", + "packages/currencies-en/src", + "packages/currencies/src", + "packages/gb-counties-en/src", + "packages/gb-counties/src", "packages/model/src", + "packages/regions-en/src", + "packages/regions/src", "packages/repository/src" ] } @@ -35,7 +47,13 @@ "extra": { "laravel": { "providers": [ + "Squire\\ContinentsEnServiceProvider", + "Squire\\RegionsEnServiceProvider", + "Squire\\GbCountiesEnServiceProvider", + "Squire\\AirlinesEnServiceProvider", "Squire\\CountriesEnServiceProvider", + "Squire\\AirportsEnServiceProvider", + "Squire\\CurrenciesEnServiceProvider", "Squire\\RepositoryServiceProvider" ], "aliases": { @@ -44,9 +62,21 @@ } }, "replace": { + "squirephp/airlines": "self.version", + "squirephp/airlines-en": "self.version", + "squirephp/airports": "self.version", + "squirephp/airports-en": "self.version", + "squirephp/continents": "self.version", + "squirephp/continents-en": "self.version", "squirephp/countries": "self.version", "squirephp/countries-en": "self.version", + "squirephp/currencies": "self.version", + "squirephp/currencies-en": "self.version", + "squirephp/gb-counties": "self.version", + "squirephp/gb-counties-en": "self.version", "squirephp/model": "self.version", + "squirephp/regions": "self.version", + "squirephp/regions-en": "self.version", "squirephp/repository": "self.version" } } diff --git a/data/countries.csv b/data/countries.csv deleted file mode 100644 index fbbdf7c..0000000 --- a/data/countries.csv +++ /dev/null @@ -1,250 +0,0 @@ -id,calling_code,capital_city,code_2,code_3,continent_id,currency_id,flag,name -ad,376,Andorra la Vella,ad,and,eu,eur,🇦🇩,Andorra -ae,971,Abu Dhabi,ae,are,as,aed,🇦🇪,United Arab Emirates -af,93,Kabul,af,afg,as,afn,🇦🇫,Afghanistan -ag,1268,St. John's,ag,atg,na,xcd,🇦🇬,Antigua and Barbuda -ai,1264,The Valley,ai,aia,na,xcd,🇦🇮,Anguilla -al,355,Tirana,al,alb,eu,all,🇦🇱,Albania -am,374,Yerevan,am,arm,as,amd,🇦🇲,Armenia -ao,244,Luanda,ao,ago,af,aoa,🇦🇴,Angola -aq,672,,aq,ata,an,,🇦🇶,Antarctica -ar,54,Buenos Aires,ar,arg,sa,ars,🇦🇷,Argentina -as,1684,Pago Pago,as,asm,oc,usd,🇦🇸,American Samoa -at,43,Vienna,at,aut,eu,eur,🇦🇹,Austria -au,61,Canberra,au,aus,oc,aud,🇦🇺,Australia -aw,297,Oranjestad,aw,abw,na,awg,🇦🇼,Aruba -ax,358,Mariehamn,ax,ala,eu,eur,🇦🇽,Aland Islands -az,994,Baku,az,aze,as,azn,🇦🇿,Azerbaijan -ba,387,Sarajevo,ba,bih,eu,bam,🇧🇦,Bosnia and Herzegovina -bb,1246,Bridgetown,bb,brb,na,bbd,🇧🇧,Barbados -bd,880,Dhaka,bd,bgd,as,bdt,🇧🇩,Bangladesh -be,32,Brussels,be,bel,eu,eur,🇧🇪,Belgium -bf,226,Ouagadougou,bf,bfa,af,xof,🇧🇫,Burkina Faso -bg,359,Sofia,bg,bgr,eu,bgn,🇧🇬,Bulgaria -bh,973,Manama,bh,bhr,as,bhd,🇧🇭,Bahrain -bi,257,Bujumbura,bi,bdi,af,bif,🇧🇮,Burundi -bj,229,Porto-Novo,bj,ben,af,xof,🇧🇯,Benin -bl,590,Gustavia,bl,blm,na,eur,🇧🇱,Saint Barthelemy -bm,1441,Hamilton,bm,bmu,na,bmd,🇧🇲,Bermuda -bn,673,Bandar Seri Begawan,bn,brn,as,bnd,🇧🇳,Brunei -bo,591,Sucre,bo,bol,sa,bob,🇧🇴,Bolivia -bq,599,,bq,bes,na,usd,🇧🇶,"Bonaire, Saint Eustatius and Saba " -br,55,Brasilia,br,bra,sa,brl,🇧🇷,Brazil -bs,1242,Nassau,bs,bhs,na,bsd,🇧🇸,Bahamas -bt,975,Thimphu,bt,btn,as,btn,🇧🇹,Bhutan -bv,55,,bv,bvt,an,nok,🇧🇻,Bouvet Island -bw,267,Gaborone,bw,bwa,af,bwp,🇧🇼,Botswana -by,375,Minsk,by,blr,eu,byr,🇧🇾,Belarus -bz,501,Belmopan,bz,blz,na,bzd,🇧🇿,Belize -ca,1,Ottawa,ca,can,na,cad,🇨🇦,Canada -cc,61,West Island,cc,cck,as,aud,🇨🇨,Cocos Islands -cd,243,Kinshasa,cd,cod,af,cdf,🇨🇩,Democratic Republic of the Congo -cf,236,Bangui,cf,caf,af,xaf,🇨🇫,Central African Republic -cg,242,Brazzaville,cg,cog,af,xaf,🇨🇬,Republic of the Congo -ch,41,Berne,ch,che,eu,chf,🇨🇭,Switzerland -ci,225,Yamoussoukro,ci,civ,af,xof,🇨🇮,Ivory Coast -ck,682,Avarua,ck,cok,oc,nzd,🇨🇰,Cook Islands -cl,56,Santiago,cl,chl,sa,clp,🇨🇱,Chile -cm,237,Yaounde,cm,cmr,af,xaf,🇨🇲,Cameroon -cn,86,Beijing,cn,chn,as,cny,🇨🇳,China -co,57,Bogota,co,col,sa,cop,🇨🇴,Colombia -cr,506,San Jose,cr,cri,na,crc,🇨🇷,Costa Rica -cu,53,Havana,cu,cub,na,cup,🇨🇺,Cuba -cv,238,Praia,cv,cpv,af,cve,🇨🇻,Cape Verde -cw,599, Willemstad,cw,cuw,na,ang,🇨🇼,Curacao -cx,61,Flying Fish Cove,cx,cxr,as,aud,🇨🇽,Christmas Island -cy,357,Nicosia,cy,cyp,eu,eur,🇨🇾,Cyprus -cz,420,Prague,cz,cze,eu,czk,🇨🇿,Czech Republic -de,49,Berlin,de,deu,eu,eur,🇩🇪,Germany -dj,253,Djibouti,dj,dji,af,djf,🇩🇯,Djibouti -dk,45,Copenhagen,dk,dnk,eu,dkk,🇩🇰,Denmark -dm,1767,Roseau,dm,dma,na,xcd,🇩🇲,Dominica -do,1809,Santo Domingo,do,dom,na,dop,🇩🇴,Dominican Republic -dz,213,Algiers,dz,dza,af,dzd,🇩🇿,Algeria -ec,593,Quito,ec,ecu,sa,usd,🇪🇨,Ecuador -ee,372,Tallinn,ee,est,eu,eur,🇪🇪,Estonia -eg,20,Cairo,eg,egy,af,egp,🇪🇬,Egypt -eh,212,El-Aaiun,eh,esh,af,mad,🇪🇭,Western Sahara -er,291,Asmara,er,eri,af,ern,🇪🇷,Eritrea -es,34,Madrid,es,esp,eu,eur,🇪🇸,Spain -et,251,Addis Ababa,et,eth,af,etb,🇪🇹,Ethiopia -fi,358,Helsinki,fi,fin,eu,eur,🇫🇮,Finland -fj,679,Suva,fj,fji,oc,fjd,🇫🇯,Fiji -fk,500,Stanley,fk,flk,sa,fkp,🇫🇰,Falkland Islands -fm,691,Palikir,fm,fsm,oc,usd,🇫🇲,Micronesia -fo,298,Torshavn,fo,fro,eu,dkk,🇫🇴,Faroe Islands -fr,33,Paris,fr,fra,eu,eur,🇫🇷,France -ga,241,Libreville,ga,gab,af,xaf,🇬🇦,Gabon -gb,44,London,gb,gbr,eu,gbp,🇬🇧,United Kingdom -gd,1473,St. George's,gd,grd,na,xcd,🇬🇩,Grenada -ge,995,Tbilisi,ge,geo,as,gel,🇬🇪,Georgia -gf,594,Cayenne,gf,guf,sa,eur,🇬🇫,French Guiana -gg,44,St Peter Port,gg,ggy,eu,gbp,🇬🇬,Guernsey -gh,233,Accra,gh,gha,af,ghs,🇬🇭,Ghana -gi,350,Gibraltar,gi,gib,eu,gip,🇬🇮,Gibraltar -gl,299,Nuuk,gl,grl,na,dkk,🇬🇱,Greenland -gm,220,Banjul,gm,gmb,af,gmd,🇬🇲,Gambia -gn,224,Conakry,gn,gin,af,gnf,🇬🇳,Guinea -gp,590,Basse-Terre,gp,glp,na,eur,🇬🇵,Guadeloupe -gq,240,Malabo,gq,gnq,af,xaf,🇬🇶,Equatorial Guinea -gr,30,Athens,gr,grc,eu,eur,🇬🇷,Greece -gs,500,Grytviken,gs,sgs,an,gbp,🇬🇸,South Georgia and the South Sandwich Islands -gt,502,Guatemala City,gt,gtm,na,gtq,🇬🇹,Guatemala -gu,1671,Hagatna,gu,gum,oc,usd,🇬🇺,Guam -gw,245,Bissau,gw,gnb,af,xof,🇬🇼,Guinea-Bissau -gy,592,Georgetown,gy,guy,sa,gyd,🇬🇾,Guyana -hk,852,Hong Kong,hk,hkg,as,hkd,🇭🇰,Hong Kong -hn,504,Tegucigalpa,hn,hnd,na,hnl,🇭🇳,Honduras -hr,385,Zagreb,hr,hrv,eu,hrk,🇭🇷,Croatia -ht,509,Port-au-Prince,ht,hti,na,htg,🇭🇹,Haiti -hu,36,Budapest,hu,hun,eu,huf,🇭🇺,Hungary -id,62,Jakarta,id,idn,as,idr,🇮🇩,Indonesia -ie,353,Dublin,ie,irl,eu,eur,🇮🇪,Ireland -il,972,Jerusalem,il,isr,as,ils,🇮🇱,Israel -im,44,"Douglas, Isle of Man",im,imn,eu,gbp,🇮🇲,Isle of Man -in,91,New Delhi,in,ind,as,inr,🇮🇳,India -io,246,Diego Garcia,io,iot,as,usd,🇮🇴,British Indian Ocean Territory -iq,964,Baghdad,iq,irq,as,iqd,🇮🇶,Iraq -ir,98,Tehran,ir,irn,as,irr,🇮🇷,Iran -is,354,Reykjavik,is,isl,eu,isk,🇮🇸,Iceland -it,39,Rome,it,ita,eu,eur,🇮🇹,Italy -je,44,Saint Helier,je,jey,eu,gbp,🇯🇪,Jersey -jm,1876,Kingston,jm,jam,na,jmd,🇯🇲,Jamaica -jo,962,Amman,jo,jor,as,jod,🇯🇴,Jordan -jp,81,Tokyo,jp,jpn,as,jpy,🇯🇵,Japan -ke,254,Nairobi,ke,ken,af,kes,🇰🇪,Kenya -kg,996,Bishkek,kg,kgz,as,kgs,🇰🇬,Kyrgyzstan -kh,855,Phnom Penh,kh,khm,as,khr,🇰🇭,Cambodia -ki,686,Tarawa,ki,kir,oc,aud,🇰🇮,Kiribati -km,269,Moroni,km,com,af,kmf,🇰🇲,Comoros -kn,1869,Basseterre,kn,kna,na,xcd,🇰🇳,Saint Kitts and Nevis -kp,850,Pyongyang,kp,prk,as,kpw,🇰🇵,North Korea -kr,82,Seoul,kr,kor,as,krw,🇰🇷,South Korea -kw,965,Kuwait City,kw,kwt,as,kwd,🇰🇼,Kuwait -ky,1345,George Town,ky,cym,na,kyd,🇰🇾,Cayman Islands -kz,7,Astana,kz,kaz,as,kzt,🇰🇿,Kazakhstan -la,856,Vientiane,la,lao,as,lak,🇱🇦,Laos -lb,961,Beirut,lb,lbn,as,lbp,🇱🇧,Lebanon -lc,1758,Castries,lc,lca,na,xcd,🇱🇨,Saint Lucia -li,423,Vaduz,li,lie,eu,chf,🇱🇮,Liechtenstein -lk,94,Colombo,lk,lka,as,lkr,🇱🇰,Sri Lanka -lr,231,Monrovia,lr,lbr,af,lrd,🇱🇷,Liberia -ls,266,Maseru,ls,lso,af,lsl,🇱🇸,Lesotho -lt,370,Vilnius,lt,ltu,eu,ltl,🇱🇹,Lithuania -lu,352,Luxembourg,lu,lux,eu,eur,🇱🇺,Luxembourg -lv,371,Riga,lv,lva,eu,eur,🇱🇻,Latvia -ly,218,Tripolis,ly,lby,af,lyd,🇱🇾,Libya -ma,212,Rabat,ma,mar,af,mad,🇲🇦,Morocco -mc,377,Monaco,mc,mco,eu,eur,🇲🇨,Monaco -md,373,Chisinau,md,mda,eu,mdl,🇲🇩,Moldova -me,382,Podgorica,me,mne,eu,eur,🇲🇪,Montenegro -mf,590,Marigot,mf,maf,na,eur,🇲🇫,Saint Martin -mg,261,Antananarivo,mg,mdg,af,mga,🇲🇬,Madagascar -mh,692,Majuro,mh,mhl,oc,usd,🇲🇭,Marshall Islands -mk,389,Skopje,mk,mkd,eu,mkd,🇲🇰,Macedonia -ml,223,Bamako,ml,mli,af,xof,🇲🇱,Mali -mm,95,Nay Pyi Taw,mm,mmr,as,mmk,🇲🇲,Myanmar -mn,976,Ulan Bator,mn,mng,as,mnt,🇲🇳,Mongolia -mo,853,Macao,mo,mac,as,mop,🇲🇴,Macao -mp,1670,Saipan,mp,mnp,oc,usd,🇲🇵,Northern Mariana Islands -mq,596,Fort-de-France,mq,mtq,na,eur,🇲🇶,Martinique -mr,222,Nouakchott,mr,mrt,af,mro,🇲🇷,Mauritania -ms,1664,Plymouth,ms,msr,na,xcd,🇲🇸,Montserrat -mt,356,Valletta,mt,mlt,eu,eur,🇲🇹,Malta -mu,230,Port Louis,mu,mus,af,mur,🇲🇺,Mauritius -mv,960,Male,mv,mdv,as,mvr,🇲🇻,Maldives -mw,265,Lilongwe,mw,mwi,af,mwk,🇲🇼,Malawi -mx,52,Mexico City,mx,mex,na,mxn,🇲🇽,Mexico -my,60,Kuala Lumpur,my,mys,as,myr,🇲🇾,Malaysia -mz,258,Maputo,mz,moz,af,mzn,🇲🇿,Mozambique -na,264,Windhoek,na,nam,af,nad,🇳🇦,Namibia -nc,687,Noumea,nc,ncl,oc,xpf,🇳🇨,New Caledonia -ne,227,Niamey,ne,ner,af,xof,🇳🇪,Niger -nf,672,Kingston,nf,nfk,oc,aud,🇳🇫,Norfolk Island -ng,234,Abuja,ng,nga,af,ngn,🇳🇬,Nigeria -ni,505,Managua,ni,nic,na,nio,🇳🇮,Nicaragua -nl,31,Amsterdam,nl,nld,eu,eur,🇳🇱,Netherlands -no,47,Oslo,no,nor,eu,nok,🇳🇴,Norway -np,977,Kathmandu,np,npl,as,npr,🇳🇵,Nepal -nr,674,Yaren,nr,nru,oc,aud,🇳🇷,Nauru -nu,683,Alofi,nu,niu,oc,nzd,🇳🇺,Niue -nz,64,Wellington,nz,nzl,oc,nzd,🇳🇿,New Zealand -om,968,Muscat,om,omn,as,omr,🇴🇲,Oman -pa,507,Panama City,pa,pan,na,pab,🇵🇦,Panama -pe,51,Lima,pe,per,sa,pen,🇵🇪,Peru -pf,689,Papeete,pf,pyf,oc,xpf,🇵🇫,French Polynesia -pg,675,Port Moresby,pg,png,oc,pgk,🇵🇬,Papua New Guinea -ph,63,Manila,ph,phl,as,php,🇵🇭,Philippines -pk,92,Islamabad,pk,pak,as,pkr,🇵🇰,Pakistan -pl,48,Warsaw,pl,pol,eu,pln,🇵🇱,Poland -pm,508,Saint-Pierre,pm,spm,na,eur,🇵🇲,Saint Pierre and Miquelon -pn,870,Adamstown,pn,pcn,oc,nzd,🇵🇳,Pitcairn -pr,1787,San Juan,pr,pri,na,usd,🇵🇷,Puerto Rico -ps,970,East Jerusalem,ps,pse,as,ils,🇵🇸,Palestinian Territory -pt,351,Lisbon,pt,prt,eu,eur,🇵🇹,Portugal -pw,680,Melekeok,pw,plw,oc,usd,🇵🇼,Palau -py,595,Asuncion,py,pry,sa,pyg,🇵🇾,Paraguay -qa,974,Doha,qa,qat,as,qar,🇶🇦,Qatar -re,262,Saint-Denis,re,reu,af,eur,🇷🇪,Reunion -ro,40,Bucharest,ro,rou,eu,ron,🇷🇴,Romania -rs,381,Belgrade,rs,srb,eu,rsd,🇷🇸,Serbia -ru,7,Moscow,ru,rus,eu,rub,🇷🇺,Russia -rw,250,Kigali,rw,rwa,af,rwf,🇷🇼,Rwanda -sa,966,Riyadh,sa,sau,as,sar,🇸🇦,Saudi Arabia -sb,677,Honiara,sb,slb,oc,sbd,🇸🇧,Solomon Islands -sc,248,Victoria,sc,syc,af,scr,🇸🇨,Seychelles -sd,249,Khartoum,sd,sdn,af,sdg,🇸🇩,Sudan -se,46,Stockholm,se,swe,eu,sek,🇸🇪,Sweden -sg,65,Singapur,sg,sgp,as,sgd,🇸🇬,Singapore -sh,290,Jamestown,sh,shn,af,shp,🇸🇭,Saint Helena -si,386,Ljubljana,si,svn,eu,eur,🇸🇮,Slovenia -sj,47,Longyearbyen,sj,sjm,eu,nok,🇸🇯,Svalbard and Jan Mayen -sk,421,Bratislava,sk,svk,eu,eur,🇸🇰,Slovakia -sl,232,Freetown,sl,sle,af,sll,🇸🇱,Sierra Leone -sm,378,San Marino,sm,smr,eu,eur,🇸🇲,San Marino -sn,221,Dakar,sn,sen,af,xof,🇸🇳,Senegal -so,252,Mogadishu,so,som,af,sos,🇸🇴,Somalia -sr,597,Paramaribo,sr,sur,sa,srd,🇸🇷,Suriname -ss,211,Juba,ss,ssd,af,ssp,🇸🇸,South Sudan -st,239,Sao Tome,st,stp,af,std,🇸🇹,Sao Tome and Principe -sv,503,San Salvador,sv,slv,na,usd,🇸🇻,El Salvador -sx,599,Philipsburg,sx,sxm,na,ang,🇸🇽,Sint Maarten -sy,963,Damascus,sy,syr,as,syp,🇸🇾,Syria -sz,268,Mbabane,sz,swz,af,szl,🇸🇿,Swaziland -tc,1649,Cockburn Town,tc,tca,na,usd,🇹🇨,Turks and Caicos Islands -td,235,N'Djamena,td,tcd,af,xaf,🇹🇩,Chad -tf,,Port-aux-Francais,tf,atf,an,eur,🇹🇫,French Southern Territories -tg,228,Lome,tg,tgo,af,xof,🇹🇬,Togo -th,66,Bangkok,th,tha,as,thb,🇹🇭,Thailand -tj,992,Dushanbe,tj,tjk,as,tjs,🇹🇯,Tajikistan -tk,690,,tk,tkl,oc,nzd,🇹🇰,Tokelau -tl,670,Dili,tl,tls,oc,usd,🇹🇱,East Timor -tm,993,Ashgabat,tm,tkm,as,tmt,🇹🇲,Turkmenistan -tn,216,Tunis,tn,tun,af,tnd,🇹🇳,Tunisia -to,676,Nuku'alofa,to,ton,oc,top,🇹🇴,Tonga -tr,90,Ankara,tr,tur,as,try,🇹🇷,Turkey -tt,1868,Port of Spain,tt,tto,na,ttd,🇹🇹,Trinidad and Tobago -tv,688,Funafuti,tv,tuv,oc,aud,🇹🇻,Tuvalu -tw,886,Taipei,tw,twn,as,twd,🇹🇼,Taiwan -tz,255,Dodoma,tz,tza,af,tzs,🇹🇿,Tanzania -ua,380,Kiev,ua,ukr,eu,uah,🇺🇦,Ukraine -ug,256,Kampala,ug,uga,af,ugx,🇺🇬,Uganda -um,246,,um,umi,oc,usd,🇺🇲,United States Minor Outlying Islands -us,1,Washington,us,usa,na,usd,🇺🇸,United States -uy,598,Montevideo,uy,ury,sa,uyu,🇺🇾,Uruguay -uz,998,Tashkent,uz,uzb,as,uzs,🇺🇿,Uzbekistan -va,379,Vatican City,va,vat,eu,eur,🇻🇦,Vatican -vc,1784,Kingstown,vc,vct,na,xcd,🇻🇨,Saint Vincent and the Grenadines -ve,58,Caracas,ve,ven,sa,vef,🇻🇪,Venezuela -vg,1284,Road Town,vg,vgb,na,usd,🇻🇬,British Virgin Islands -vi,1340,Charlotte Amalie,vi,vir,na,usd,🇻🇮,U.S. Virgin Islands -vn,84,Hanoi,vn,vnm,as,vnd,🇻🇳,Vietnam -vu,678,Port Vila,vu,vut,oc,vuv,🇻🇺,Vanuatu -wf,681,Mata Utu,wf,wlf,oc,xpf,🇼🇫,Wallis and Futuna -ws,685,Apia,ws,wsm,oc,wst,🇼🇸,Samoa -xk,383,Pristina,xk,xkx,eu,eur,🇽🇰,Kosovo -ye,967,Sanaa,ye,yem,as,yer,🇾🇪,Yemen -yt,262,Mamoudzou,yt,myt,af,eur,🇾🇹,Mayotte -za,27,Pretoria,za,zaf,af,zar,🇿🇦,South Africa -zm,260,Lusaka,zm,zmb,af,zmk,🇿🇲,Zambia -zw,263,Harare,zw,zwe,af,zwl,🇿🇼,Zimbabwe \ No newline at end of file diff --git a/packages/airlines-en/composer.json b/packages/airlines-en/composer.json new file mode 100644 index 0000000..317c379 --- /dev/null +++ b/packages/airlines-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/airlines-en", + "description": "A library containing the English translation of Squire's Airline 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": "dan@danharrin.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "squirephp/airlines": "^2.0", + "squirephp/repository": "^2.0" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\AirlinesEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/airlines.csv b/packages/airlines-en/data.csv similarity index 100% rename from data/airlines.csv rename to packages/airlines-en/data.csv diff --git a/packages/airlines-en/src/AirlinesEnServiceProvider.php b/packages/airlines-en/src/AirlinesEnServiceProvider.php new file mode 100644 index 0000000..2ac4d74 --- /dev/null +++ b/packages/airlines-en/src/AirlinesEnServiceProvider.php @@ -0,0 +1,15 @@ +belongsTo(Country::class); + } + + public function continent() + { + return $this->hasOneThrough(Continent::class, Country::class); + } +} \ No newline at end of file diff --git a/packages/airports-en/composer.json b/packages/airports-en/composer.json new file mode 100644 index 0000000..ee28d92 --- /dev/null +++ b/packages/airports-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/airports-en", + "description": "A library containing the English translation of Squire's Airport 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": "dan@danharrin.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "squirephp/airports": "^2.0", + "squirephp/repository": "^2.0" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\AirportsEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/airports.csv b/packages/airports-en/data.csv similarity index 100% rename from data/airports.csv rename to packages/airports-en/data.csv diff --git a/packages/airports-en/src/AirportsEnServiceProvider.php b/packages/airports-en/src/AirportsEnServiceProvider.php new file mode 100644 index 0000000..d748161 --- /dev/null +++ b/packages/airports-en/src/AirportsEnServiceProvider.php @@ -0,0 +1,15 @@ +hasOneThrough(Country::class, Region::class); + } + + public function region() + { + return $this->belongsTo(Region::class); + } +} \ No newline at end of file diff --git a/packages/continents-en/composer.json b/packages/continents-en/composer.json new file mode 100644 index 0000000..623adc8 --- /dev/null +++ b/packages/continents-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/continents-en", + "description": "A library containing the English 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": "dan@danharrin.com" + } + ], + "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\\ContinentsEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/continents.csv b/packages/continents-en/data.csv similarity index 100% rename from data/continents.csv rename to packages/continents-en/data.csv diff --git a/packages/continents-en/src/ContinentsEnServiceProvider.php b/packages/continents-en/src/ContinentsEnServiceProvider.php new file mode 100644 index 0000000..5d51105 --- /dev/null +++ b/packages/continents-en/src/ContinentsEnServiceProvider.php @@ -0,0 +1,15 @@ +hasMany(Country::class); + } + + public function regions() + { + return $this->hasManyThrough(Region::class, Country::class); + } +} \ No newline at end of file diff --git a/packages/currencies-en/composer.json b/packages/currencies-en/composer.json new file mode 100644 index 0000000..288bb91 --- /dev/null +++ b/packages/currencies-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/currencies-en", + "description": "A library containing the English translation of Squire's Currency 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": "dan@danharrin.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "squirephp/currencies": "^2.0", + "squirephp/repository": "^2.0" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\CurrenciesEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/currencies.csv b/packages/currencies-en/data.csv similarity index 100% rename from data/currencies.csv rename to packages/currencies-en/data.csv diff --git a/packages/currencies-en/src/CurrenciesEnServiceProvider.php b/packages/currencies-en/src/CurrenciesEnServiceProvider.php new file mode 100644 index 0000000..d77f98f --- /dev/null +++ b/packages/currencies-en/src/CurrenciesEnServiceProvider.php @@ -0,0 +1,15 @@ +hasMany(Country::class); + } +} \ No newline at end of file diff --git a/packages/gb-counties-en/composer.json b/packages/gb-counties-en/composer.json new file mode 100644 index 0000000..9f32836 --- /dev/null +++ b/packages/gb-counties-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/gb-counties-en", + "description": "A library containing the English translation of Squire's GbCounty 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": "dan@danharrin.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "squirephp/gb-counties": "^2.0", + "squirephp/repository": "^2.0" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\GbCountiesEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/counties/gb.csv b/packages/gb-counties-en/data.csv similarity index 100% rename from data/counties/gb.csv rename to packages/gb-counties-en/data.csv diff --git a/packages/gb-counties-en/src/GbCountiesEnServiceProvider.php b/packages/gb-counties-en/src/GbCountiesEnServiceProvider.php new file mode 100644 index 0000000..d24b38e --- /dev/null +++ b/packages/gb-counties-en/src/GbCountiesEnServiceProvider.php @@ -0,0 +1,15 @@ +belongsTo(Region::class); + } +} \ No newline at end of file diff --git a/packages/regions-en/composer.json b/packages/regions-en/composer.json new file mode 100644 index 0000000..b5bb515 --- /dev/null +++ b/packages/regions-en/composer.json @@ -0,0 +1,39 @@ +{ + "name": "squirephp/regions-en", + "description": "A library containing the English translation of Squire's Region 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": "dan@danharrin.com" + } + ], + "require": { + "php": "^7.2|^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "squirephp/regions": "^2.0", + "squirephp/repository": "^2.0" + }, + "autoload": { + "psr-4": { + "Squire\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "Squire\\RegionsEnServiceProvider" + ] + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/data/regions.csv b/packages/regions-en/data.csv similarity index 100% rename from data/regions.csv rename to packages/regions-en/data.csv diff --git a/packages/regions-en/src/RegionsEnServiceProvider.php b/packages/regions-en/src/RegionsEnServiceProvider.php new file mode 100644 index 0000000..b451a40 --- /dev/null +++ b/packages/regions-en/src/RegionsEnServiceProvider.php @@ -0,0 +1,15 @@ +hasMany(Airport::class); + } + + public function continent() + { + return $this->hasOneThrough(Continent::class, Country::class); + } + + public function country() + { + return $this->belongsTo(Country::class); + } + + public function gbCounties() + { + return $this->hasMany(GbCounty::class); + } +} \ No newline at end of file