Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jan 9, 2021
1 parent cb39cc5 commit e15f264
Show file tree
Hide file tree
Showing 33 changed files with 650 additions and 258 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -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);
});
```
Expand All @@ -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
{
Expand Down
30 changes: 30 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Expand All @@ -35,7 +47,13 @@
"extra": {
"laravel": {
"providers": [
"Squire\\ContinentsEnServiceProvider",
"Squire\\RegionsEnServiceProvider",
"Squire\\GbCountiesEnServiceProvider",
"Squire\\AirlinesEnServiceProvider",
"Squire\\CountriesEnServiceProvider",
"Squire\\AirportsEnServiceProvider",
"Squire\\CurrenciesEnServiceProvider",
"Squire\\RepositoryServiceProvider"
],
"aliases": {
Expand All @@ -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"
}
}
250 changes: 0 additions & 250 deletions data/countries.csv

This file was deleted.

39 changes: 39 additions & 0 deletions packages/airlines-en/composer.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
],
"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"
}
File renamed without changes.
Loading

0 comments on commit e15f264

Please sign in to comment.