From 5a6e6a942ee17c312b6eadc6f8fe8f95c73bad1f Mon Sep 17 00:00:00 2001 From: Wizofgoz Date: Tue, 15 May 2018 14:16:22 -0700 Subject: [PATCH 1/5] Updated TravisCI config Don't need npm after splitting angular components into separate repo --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0da9247..9e813d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,6 @@ before_script: - composer install --optimize-autoloader - php artisan config:cache - php artisan route:cache - - cd resources/assets/src/evecommander - - npm install - - npm run build after_success: - rm .env From d9baec8a341c8d3b833b4992b1f564c1b6bbf3a0 Mon Sep 17 00:00:00 2001 From: Wizofgoz Date: Tue, 15 May 2018 14:32:32 -0700 Subject: [PATCH 2/5] Removed old routes --- config/app.php | 1 + routes/api.php | 4 +++- routes/web.php | 25 ------------------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/config/app.php b/config/app.php index 831476e..c47c77d 100644 --- a/config/app.php +++ b/config/app.php @@ -167,6 +167,7 @@ /* * Package Service Providers... */ + Irazasyed\JwtAuthGuard\JwtAuthGuardServiceProvider::class, /* * Application Service Providers... diff --git a/routes/api.php b/routes/api.php index 2634782..231339e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -16,7 +16,9 @@ | is assigned the "api" middleware group. Enjoy building your API! | */ - +Route::get('/', function () { + return []; +}); Route::post('login', 'AuthController@login'); Route::post('logout', 'AuthController@logout'); Route::post('refresh', 'AuthController@refresh'); diff --git a/routes/web.php b/routes/web.php index 7a495e3..97212ab 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,4 @@ name('welcome'); - -Route::resource('characters', 'CharacterController', ['except' => [ - 'edit' -]]); - -Route::prefix('characters/{id}')->group(function () { - Route::resources([ - 'coalitions' => 'CoalitionController', - 'comments' => 'CommentController', - 'discounts' => 'DiscountController', - 'doctrines' => 'DoctrineController', - 'handbooks' => 'HandbookController', - 'invoices' => 'InvoiceController', - 'memberships' => 'MembershipController', - 'replacements' => 'ReplacementClaimController', - 'settings' => 'SettingController', - ]); -}); - -Auth::routes(); - -Route::get('/home', 'HomeController@index')->name('home'); From 73cefc1cc2eb0873a66fb53945b2e9ba46d52557 Mon Sep 17 00:00:00 2001 From: Wizofgoz Date: Tue, 15 May 2018 14:35:12 -0700 Subject: [PATCH 3/5] Route caching won't work with closure routes also won't work with the JSON API package --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9e813d3..89920d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ before_script: - sudo apt install node - composer install --optimize-autoloader - php artisan config:cache - - php artisan route:cache after_success: - rm .env From d3550391798ef8ec1b4f4208f70fa230ab80f4ff Mon Sep 17 00:00:00 2001 From: Wizofgoz Date: Thu, 17 May 2018 14:02:23 -0700 Subject: [PATCH 4/5] Defined Schemas --- app/Abstracts/Organization.php | 15 +- app/Alliance.php | 25 ++- app/BillingCondition.php | 5 + app/Character.php | 15 ++ app/Coalition.php | 33 ++++ app/Comment.php | 8 +- app/Corporation.php | 23 +++ app/Discount.php | 4 + app/Doctrine.php | 6 + app/Fitting.php | 6 + app/Fleet.php | 10 ++ app/FleetType.php | 16 ++ app/Handbook.php | 6 + app/Invoice.php | 34 ++-- app/InvoiceItem.php | 18 ++- app/JsonApi/Adapters/Alliance.php | 2 +- app/JsonApi/Adapters/Character.php | 32 ++-- app/JsonApi/Schemas/Alliance.php | 11 +- app/JsonApi/Schemas/BillingCondition.php | 60 +++++-- app/JsonApi/Schemas/Character.php | 3 +- app/JsonApi/Schemas/Coalition.php | 3 +- app/JsonApi/Schemas/Comment.php | 20 ++- app/JsonApi/Schemas/Corporation.php | 149 ++++++++++++++++-- app/JsonApi/Schemas/Discount.php | 59 +++++-- app/JsonApi/Schemas/Doctrine.php | 74 +++++++-- app/JsonApi/Schemas/Fitting.php | 70 ++++++-- app/JsonApi/Schemas/Fleet.php | 99 ++++++++++-- app/JsonApi/Schemas/FleetType.php | 55 +++++-- app/JsonApi/Schemas/Handbook.php | 75 +++++++-- app/JsonApi/Schemas/Invoice.php | 93 +++++++++-- app/JsonApi/Schemas/InvoiceItem.php | 57 +++++-- app/JsonApi/Schemas/Membership.php | 100 ++++++++++-- app/JsonApi/Schemas/MembershipFee.php | 55 +++++-- app/JsonApi/Schemas/MembershipLevel.php | 80 ++++++++-- app/JsonApi/Schemas/OAuth2Token.php | 51 ++++-- app/JsonApi/Schemas/Permission.php | 47 ++++-- app/JsonApi/Schemas/ReplacementClaim.php | 75 +++++++-- app/JsonApi/Schemas/User.php | 66 ++++++-- app/Membership.php | 10 ++ app/MembershipFee.php | 4 + app/MembershipLevel.php | 7 + app/OAuth2Token.php | 7 +- app/Permission.php | 14 ++ app/ReplacementClaim.php | 21 ++- app/Traits/HasHandbooks.php | 5 + app/User.php | 6 + ..._01_16_052904_create_fleet_types_table.php | 2 + 47 files changed, 1404 insertions(+), 232 deletions(-) diff --git a/app/Abstracts/Organization.php b/app/Abstracts/Organization.php index 708acd1..0d64538 100644 --- a/app/Abstracts/Organization.php +++ b/app/Abstracts/Organization.php @@ -2,6 +2,7 @@ namespace App\Abstracts; +use App\FleetType; use App\Traits\HasHandbooks; use App\Traits\HasMembers; use App\Traits\IsMember; @@ -9,9 +10,15 @@ abstract class Organization extends Model { - use HasHandbooks; - use HasMembers; - use IsMember; + use HasHandbooks, HasMembers, IsMember; - public $incrementing = false; + /** + * Get relation between this organization and any fleet types it owns. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphMany + */ + public function fleetTypes() + { + return $this->morphMany(FleetType::class, 'owner'); + } } \ No newline at end of file diff --git a/app/Alliance.php b/app/Alliance.php index 121437d..fc0d732 100644 --- a/app/Alliance.php +++ b/app/Alliance.php @@ -6,6 +6,7 @@ use App\Traits\HasSRP; use App\Traits\IssuesInvoices; use App\Traits\ReceivesInvoices; +use App\Traits\UuidTrait; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Carbon; @@ -19,10 +20,32 @@ * @property array settings * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany handbooks + * @property \Illuminate\Database\Eloquent\Relations\MorphMany members + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo defaultMembershipLevel + * @property \Illuminate\Database\Eloquent\Relations\MorphMany membershipLevels + * @property \Illuminate\Database\Eloquent\Relations\MorphMany memberships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany claims + * @property \Illuminate\Database\Eloquent\Relations\MorphMany invoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany issuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany coalition */ class Alliance extends Organization { - use HasSRP, ReceivesInvoices, IssuesInvoices, Notifiable; + use UuidTrait, HasSRP, ReceivesInvoices, IssuesInvoices, Notifiable; protected $casts = [ 'settings' => 'array' diff --git a/app/BillingCondition.php b/app/BillingCondition.php index 9c9535a..d2775c3 100644 --- a/app/BillingCondition.php +++ b/app/BillingCondition.php @@ -18,6 +18,11 @@ * @property int|null quantity * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\HasMany discounts + * @property \Illuminate\Database\Eloquent\Relations\BelongsToMany membershipFees */ class BillingCondition extends Model { diff --git a/app/Character.php b/app/Character.php index 0017d18..b86c42a 100644 --- a/app/Character.php +++ b/app/Character.php @@ -19,6 +19,21 @@ * @property string name * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany invoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany memberships + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo user + * @property \Illuminate\Database\Eloquent\Relations\HasOne token + * @property \Illuminate\Database\Eloquent\Relations\HasMany comments + * @property \Illuminate\Database\Eloquent\Relations\MorphMany corporation */ class Character extends Model { diff --git a/app/Coalition.php b/app/Coalition.php index 7296207..e72f1c8 100644 --- a/app/Coalition.php +++ b/app/Coalition.php @@ -21,6 +21,29 @@ * @property array settings * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany handbooks + * @property \Illuminate\Database\Eloquent\Relations\MorphMany members + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo defaultMembershipLevel + * @property \Illuminate\Database\Eloquent\Relations\MorphMany membershipLevels + * @property \Illuminate\Database\Eloquent\Relations\MorphMany memberships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany claims + * @property \Illuminate\Database\Eloquent\Relations\MorphMany invoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany issuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo leader + * @property \Illuminate\Database\Eloquent\Relations\MorphMany alliances */ class Coalition extends Organization { @@ -44,11 +67,21 @@ public function receivedInvoiceSubscribers() return $subscribers; } + /** + * Get relation between this coalition and the character that is designated as the leader + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function leader() { return $this->belongsTo(Character::class, 'leader_character_id'); } + /** + * Get relation between this coalition and any alliances that are members of it + * + * @return \Illuminate\Database\Eloquent\Relations\MorphMany + */ public function alliances() { return $this->members()->where('member_type', Alliance::class)->with('member'); diff --git a/app/Comment.php b/app/Comment.php index 6af45ca..81e1a6e 100644 --- a/app/Comment.php +++ b/app/Comment.php @@ -2,7 +2,6 @@ namespace App; -use App\Traits\Commentable; use App\Traits\HasComments; use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; @@ -17,6 +16,11 @@ * @property string text * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo character + * @property \Illuminate\Database\Eloquent\Relations\MorphTo commentable */ class Comment extends Model { @@ -35,7 +39,7 @@ public function character() /** * Get the owning commentable model. * - * @return mixed + * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ public function commentable() { diff --git a/app/Corporation.php b/app/Corporation.php index 383b561..b0f222e 100644 --- a/app/Corporation.php +++ b/app/Corporation.php @@ -20,6 +20,29 @@ * @property array settings * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany handbooks + * @property \Illuminate\Database\Eloquent\Relations\MorphMany members + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo defaultMembershipLevel + * @property \Illuminate\Database\Eloquent\Relations\MorphMany membershipLevels + * @property \Illuminate\Database\Eloquent\Relations\MorphMany memberships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany claims + * @property \Illuminate\Database\Eloquent\Relations\MorphMany invoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany issuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany fulfilledIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany overdueIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany pendingIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany defaultIssuedInvoices + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany alliance + * @property \Illuminate\Database\Eloquent\Relations\MorphMany characters */ class Corporation extends Organization { diff --git a/app/Discount.php b/app/Discount.php index d142be8..b89f512 100644 --- a/app/Discount.php +++ b/app/Discount.php @@ -18,6 +18,10 @@ * @property double amount * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo billingCondition */ class Discount extends Model { diff --git a/app/Doctrine.php b/app/Doctrine.php index 3a56960..2b0823a 100644 --- a/app/Doctrine.php +++ b/app/Doctrine.php @@ -19,6 +19,12 @@ * @property string last_updated_by * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\HasMany fittings + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo createdBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo lastUpdatedBy */ class Doctrine extends Model { diff --git a/app/Fitting.php b/app/Fitting.php index 1f46f9d..8796713 100644 --- a/app/Fitting.php +++ b/app/Fitting.php @@ -18,6 +18,12 @@ * @property int api_id * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo doctrine + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\HasMany replacementClaims */ class Fitting extends Model { diff --git a/app/Fleet.php b/app/Fleet.php index ef19381..81c5643 100644 --- a/app/Fleet.php +++ b/app/Fleet.php @@ -24,6 +24,16 @@ * @property string last_updated_by * @property Carbon created_at * @property Carbon updated_at + * + * Relations + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo fleetType + * @property \Illuminate\Database\Eloquent\Relations\MorphTo organization + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo createdBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo lastUpdatedBy */ class Fleet extends Model { diff --git a/app/FleetType.php b/app/FleetType.php index b4c2feb..da1b583 100644 --- a/app/FleetType.php +++ b/app/FleetType.php @@ -12,8 +12,14 @@ * @property string id * @property string name * @property string description + * @property string owner_id + * @property string owner_type * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\HasMany fleets + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner */ class FleetType extends Model { @@ -28,4 +34,14 @@ public function fleets() { return $this->hasMany(Fleet::class); } + + /** + * Get relation between this fleet type and the organization that owns it. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ + public function owner() + { + return $this->morphTo(); + } } diff --git a/app/Handbook.php b/app/Handbook.php index dca4e97..a03e870 100644 --- a/app/Handbook.php +++ b/app/Handbook.php @@ -20,6 +20,12 @@ * @property string last_updated_by * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo createdBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo lastUpdatedBy */ class Handbook extends Model { diff --git a/app/Invoice.php b/app/Invoice.php index 2d42197..fd48bb1 100644 --- a/app/Invoice.php +++ b/app/Invoice.php @@ -13,17 +13,29 @@ /** * Class Invoice * - * @property string $id - * @property string $owner_id - * @property string $owner_type - * @property string $recipient_id - * @property string $recipient_type - * @property string $code - * @property string $title - * @property string $status - * @property double $total - * @property Carbon $due_date - * @property Carbon $hard_due_date + * @property string id + * @property string owner_id + * @property string owner_type + * @property string recipient_id + * @property string recipient_type + * @property string code + * @property string title + * @property string status + * @property double total + * @property Carbon due_date + * @property Carbon hard_due_date + * @property Carbon created_at + * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\MorphTo issuer + * @property \Illuminate\Database\Eloquent\Relations\MorphTo recipient + * @property \Illuminate\Database\Eloquent\Relations\HasMany items + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany payments */ class Invoice extends Model { diff --git a/app/InvoiceItem.php b/app/InvoiceItem.php index 4f114d0..15a6fe2 100644 --- a/app/InvoiceItem.php +++ b/app/InvoiceItem.php @@ -2,9 +2,9 @@ namespace App; -use App\Traits\Commentable; use App\Traits\HasComments; use App\Traits\UuidTrait; +use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; /** @@ -15,20 +15,24 @@ * @property string description * @property int quantity * @property double cost - * @property string created_at - * @property string updated_at + * @property Carbon created_at + * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo invoice */ class InvoiceItem extends Model { use HasComments, UuidTrait; /** - * Get the total cost of the invoice item + * Get relation between this invoice item and the invoice it belongs to. * - * @return float|int + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function getTotal() + public function invoice() { - return $this->quantity * $this->cost; + return $this->belongsTo(Invoice::class); } } diff --git a/app/JsonApi/Adapters/Alliance.php b/app/JsonApi/Adapters/Alliance.php index eb3513e..5f87beb 100644 --- a/app/JsonApi/Adapters/Alliance.php +++ b/app/JsonApi/Adapters/Alliance.php @@ -97,7 +97,7 @@ public function memberships() public function coalition() { - return $this->belongsTo(); + return $this->hasMany(); } public function claims() diff --git a/app/JsonApi/Adapters/Character.php b/app/JsonApi/Adapters/Character.php index faad997..7a7e296 100644 --- a/app/JsonApi/Adapters/Character.php +++ b/app/JsonApi/Adapters/Character.php @@ -35,6 +35,7 @@ class Character extends AbstractAdapter 'notifications', 'readNotifications', 'unreadNotifications', + 'corporation', ]; /** @@ -47,62 +48,67 @@ public function __construct(StandardStrategy $paging) parent::__construct(new \App\Character(), $paging); } - protected function user() + public function user() { return $this->belongsTo(); } - protected function token() + public function token() { - return$this->hasOne(); + return $this->hasOne(); } - protected function comments() + public function comments() { return $this->hasMany(); } - protected function memberships() + public function memberships() { return $this->hasMany(); } - protected function invoices() + public function invoices() { return $this->hasMany(); } - protected function fulfilledInvoices() + public function fulfilledInvoices() { return $this->hasMany(); } - protected function overdueInvoices() + public function overdueInvoices() { return $this->hasMany(); } - protected function pendingInvoices() + public function pendingInvoices() { return $this->hasMany(); } - protected function defaultInvoices() + public function defaultInvoices() { return $this->hasMany(); } - protected function notifications() + public function notifications() { return $this->hasMany(); } - protected function readNotifications() + public function readNotifications() { return $this->hasMany(); } - protected function unreadNotifications() + public function unreadNotifications() + { + return $this->hasMany(); + } + + public function corporation() { return $this->hasMany(); } diff --git a/app/JsonApi/Schemas/Alliance.php b/app/JsonApi/Schemas/Alliance.php index 68996c8..616ce2f 100644 --- a/app/JsonApi/Schemas/Alliance.php +++ b/app/JsonApi/Schemas/Alliance.php @@ -13,7 +13,7 @@ class Alliance extends SchemaProvider protected $resourceType = 'alliances'; /** - * @param $resource + * @param \App\Alliance $resource * the domain record being serialized. * @return string */ @@ -32,14 +32,14 @@ public function getAttributes($resource) return [ 'api-id' => $resource->api_id, 'name' => $resource->name, - 'default-membership-level' => $resource->default_membership_level, + 'settings' => $resource->settings, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** - * @param \App\Coalition $resource + * @param \App\Alliance $resource * @param bool $isPrimary * @param array $includeRelationships * @return array @@ -145,7 +145,10 @@ public function getRelationships($resource, $isPrimary, array $includeRelationsh 'coalition' => [ self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true + self::SHOW_DATA => isset($includeRelationships['coalition']), + self::DATA => function () use ($resource) { + return $resource->coalition; + } ] ]; } diff --git a/app/JsonApi/Schemas/BillingCondition.php b/app/JsonApi/Schemas/BillingCondition.php index e119e0a..cbc005d 100644 --- a/app/JsonApi/Schemas/BillingCondition.php +++ b/app/JsonApi/Schemas/BillingCondition.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class BillingCondition extends AbstractSchema +class BillingCondition extends SchemaProvider { /** @@ -13,18 +13,58 @@ class BillingCondition extends AbstractSchema protected $resourceType = 'billing-conditions'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\BillingCondition $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\BillingCondition $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'type' => $resource->type, + 'quantity' => $resource->quantity, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + + /** + * @param \App\BillingCondition $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => true, + ], + + 'discounts' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], + + 'membership-fees' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Character.php b/app/JsonApi/Schemas/Character.php index af2f932..bd881a8 100644 --- a/app/JsonApi/Schemas/Character.php +++ b/app/JsonApi/Schemas/Character.php @@ -13,7 +13,7 @@ class Character extends SchemaProvider protected $resourceType = 'characters'; /** - * @param $resource + * @param \App\Character $resource * the domain record being serialized. * @return string */ @@ -32,7 +32,6 @@ public function getAttributes($resource) return [ 'name' => $resource->name, 'eve-id' => $resource->eve_id, - 'user-id' => $resource->user_id, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; diff --git a/app/JsonApi/Schemas/Coalition.php b/app/JsonApi/Schemas/Coalition.php index d19a90b..4a3ac5a 100644 --- a/app/JsonApi/Schemas/Coalition.php +++ b/app/JsonApi/Schemas/Coalition.php @@ -13,7 +13,7 @@ class Coalition extends SchemaProvider protected $resourceType = 'coalitions'; /** - * @param $resource + * @param \App\Coalition $resource * the domain record being serialized. * @return string */ @@ -30,7 +30,6 @@ public function getId($resource) public function getAttributes($resource) { return [ - 'leader-character-id' => $resource->leader_character_id, 'name' => $resource->name, 'description' => $resource->description, 'logo' => $resource->logo, diff --git a/app/JsonApi/Schemas/Comment.php b/app/JsonApi/Schemas/Comment.php index e7d44e0..ad55b58 100644 --- a/app/JsonApi/Schemas/Comment.php +++ b/app/JsonApi/Schemas/Comment.php @@ -13,7 +13,7 @@ class Comment extends SchemaProvider protected $resourceType = 'comments'; /** - * @param $resource + * @param \App\Comment $resource * the domain record being serialized. * @return string */ @@ -30,9 +30,7 @@ public function getId($resource) public function getAttributes($resource) { return [ - 'name' => $resource->name, - 'eve-id' => $resource->eve_id, - 'user-id' => $resource->user_id, + 'text' => $resource->text, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -46,7 +44,19 @@ public function getAttributes($resource) */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { - return []; + return [ + 'character' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => true + ], + + 'commentable' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => true + ] + ]; } } diff --git a/app/JsonApi/Schemas/Corporation.php b/app/JsonApi/Schemas/Corporation.php index dc4e77c..b4d0faf 100644 --- a/app/JsonApi/Schemas/Corporation.php +++ b/app/JsonApi/Schemas/Corporation.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Corporation extends AbstractSchema +class Corporation extends SchemaProvider { /** @@ -13,18 +13,147 @@ class Corporation extends AbstractSchema protected $resourceType = 'corporations'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Corporation $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Corporation $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'api-id' => $resource->api_id, + 'name' => $resource->name, + 'default-membership-level' => $resource->default_membership_level, + 'settings' => $resource->settings, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Corporation $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'handbooks' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'members' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'defaultMembershipLevel' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'membershipLevels' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'memberships' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'claims' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'invoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'fulfilledInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'overdueInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'pendingInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'defaultInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'issuedInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'fulfilledIssuedInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'overdueIssuedInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'pendingIssuedInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'defaultIssuedInvoices' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'notifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'readNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'unreadNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'alliance' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => true + ], + + 'characters' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Discount.php b/app/JsonApi/Schemas/Discount.php index afbbd17..4f0308e 100644 --- a/app/JsonApi/Schemas/Discount.php +++ b/app/JsonApi/Schemas/Discount.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Discount extends AbstractSchema +class Discount extends SchemaProvider { /** @@ -13,18 +13,57 @@ class Discount extends AbstractSchema protected $resourceType = 'discounts'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Discount $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Discount $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'amount-type' => $resource->amount_type, + 'amount' => $resource->amount, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Discount $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'billingCondition' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['billing-condition']), + self::DATA => function () use ($resource) { + return $resource->billingCondition; + } + ], + ]; + } } diff --git a/app/JsonApi/Schemas/Doctrine.php b/app/JsonApi/Schemas/Doctrine.php index 73f01d0..ab53bbd 100644 --- a/app/JsonApi/Schemas/Doctrine.php +++ b/app/JsonApi/Schemas/Doctrine.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Doctrine extends AbstractSchema +class Doctrine extends SchemaProvider { /** @@ -13,18 +13,72 @@ class Doctrine extends AbstractSchema protected $resourceType = 'doctrines'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Doctrine $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Doctrine $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'priority' => $resource->priority, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Doctrine $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'fittings' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'createdBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { + return $resource->createdBy; + } + ], + + 'lastUpdatedBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { + return $resource->lastUpdatedBy; + } + ], + ]; + } } diff --git a/app/JsonApi/Schemas/Fitting.php b/app/JsonApi/Schemas/Fitting.php index 845fffc..8785c90 100644 --- a/app/JsonApi/Schemas/Fitting.php +++ b/app/JsonApi/Schemas/Fitting.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Fitting extends AbstractSchema +class Fitting extends SchemaProvider { /** @@ -13,18 +13,68 @@ class Fitting extends AbstractSchema protected $resourceType = 'fittings'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Fitting $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Fitting $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'api-id' => $resource->api_id, + 'name' => $resource->name, + 'description' => $resource->description, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Fitting $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'doctrine' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['doctrine']), + self::DATA => function () use ($resource) { + return $resource->doctrine; + } + ], + + 'replacementClaims' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + ]; + } } diff --git a/app/JsonApi/Schemas/Fleet.php b/app/JsonApi/Schemas/Fleet.php index 2d092d3..4fbce3e 100644 --- a/app/JsonApi/Schemas/Fleet.php +++ b/app/JsonApi/Schemas/Fleet.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Fleet extends AbstractSchema +class Fleet extends SchemaProvider { /** @@ -13,18 +13,97 @@ class Fleet extends AbstractSchema protected $resourceType = 'fleets'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Fleet $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Fleet $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'title' => $resource->title, + 'description' => $resource->description, + 'start-time' => $resource->start_time->toIso8601String(), + 'end-time' => $resource->end_time->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Fleet $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'notifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'readNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'unreadNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'fleetType' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['fleetType']), + self::DATA => function () use ($resource) { + return $resource->fleetType; + } + ], + + 'organization' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { + return $resource->organization; + } + ], + + 'createdBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { + return $resource->createdBy; + } + ], + + 'lastUpdatedBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { + return $resource->lastUpdatedBy; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/FleetType.php b/app/JsonApi/Schemas/FleetType.php index 9bcdb18..d3a9454 100644 --- a/app/JsonApi/Schemas/FleetType.php +++ b/app/JsonApi/Schemas/FleetType.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class FleetType extends AbstractSchema +class FleetType extends SchemaProvider { /** @@ -13,18 +13,53 @@ class FleetType extends AbstractSchema protected $resourceType = 'fleet-types'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\FleetType $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\FleetType $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\FleetType $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'fleets' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Handbook.php b/app/JsonApi/Schemas/Handbook.php index ae033e4..054e34b 100644 --- a/app/JsonApi/Schemas/Handbook.php +++ b/app/JsonApi/Schemas/Handbook.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Handbook extends AbstractSchema +class Handbook extends SchemaProvider { /** @@ -13,18 +13,73 @@ class Handbook extends AbstractSchema protected $resourceType = 'handbooks'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Handbook $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Handbook $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'title' => $resource->title, + 'description' => $resource->description, + 'content' => $resource->content, + 'order' => $resource->order, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Handbook $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'createdBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { + return $resource->createdBy; + } + ], + + 'lastUpdatedBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { + return $resource->lastUpdatedBy; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Invoice.php b/app/JsonApi/Schemas/Invoice.php index 5aecdb4..b505d64 100644 --- a/app/JsonApi/Schemas/Invoice.php +++ b/app/JsonApi/Schemas/Invoice.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Invoice extends AbstractSchema +class Invoice extends SchemaProvider { /** @@ -13,18 +13,91 @@ class Invoice extends AbstractSchema protected $resourceType = 'invoices'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Invoice $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Invoice $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'code' => $resource->code, + 'title' => $resource->title, + 'status' => $resource->status, + 'total' => $resource->total, + 'due-date' => $resource->due_date->toIso8601String(), + 'hard-due-date' => $resource->hard_due_date->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Invoice $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'notifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'readNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'unreadNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'payments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'issuer' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['issuer']), + self::DATA => function () use ($resource) { + return $resource->issuer; + } + ], + + 'recipient' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['recipient']), + self::DATA => function () use ($resource) { + return $resource->recipient; + } + ], + + 'items' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ] + ]; + } } diff --git a/app/JsonApi/Schemas/InvoiceItem.php b/app/JsonApi/Schemas/InvoiceItem.php index aac2613..1d36fc2 100644 --- a/app/JsonApi/Schemas/InvoiceItem.php +++ b/app/JsonApi/Schemas/InvoiceItem.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class InvoiceItem extends AbstractSchema +class InvoiceItem extends SchemaProvider { /** @@ -13,18 +13,55 @@ class InvoiceItem extends AbstractSchema protected $resourceType = 'invoice-items'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\InvoiceItem $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\InvoiceItem $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'quantity' => $resource->quantity, + 'cost' => $resource->cost, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\InvoiceItem $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'invoice' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['invoice']), + self::DATA => function () use ($resource) { + return $resource->invoice; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Membership.php b/app/JsonApi/Schemas/Membership.php index 926221d..dcaaf1d 100644 --- a/app/JsonApi/Schemas/Membership.php +++ b/app/JsonApi/Schemas/Membership.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Membership extends AbstractSchema +class Membership extends SchemaProvider { /** @@ -13,18 +13,98 @@ class Membership extends AbstractSchema protected $resourceType = 'memberships'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Membership $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Membership $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'notes' => $resource->notes, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Membership $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'notifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'readNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'unreadNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'membershipLevel' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['membershipLevel']), + self::DATA => function () use ($resource) { + return $resource->membershipLevel; + } + ], + + 'organization' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { + return $resource->organization; + } + ], + + 'member' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['member']), + self::DATA => function () use ($resource) { + return $resource->member; + } + ], + + 'createdBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { + return $resource->createdBy; + } + ], + + 'lastUpdatedBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { + return $resource->lastUpdatedBy; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/MembershipFee.php b/app/JsonApi/Schemas/MembershipFee.php index 45541ca..1d9a81b 100644 --- a/app/JsonApi/Schemas/MembershipFee.php +++ b/app/JsonApi/Schemas/MembershipFee.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class MembershipFee extends AbstractSchema +class MembershipFee extends SchemaProvider { /** @@ -13,18 +13,53 @@ class MembershipFee extends AbstractSchema protected $resourceType = 'membership-fees'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\MembershipFee $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\MembershipFee $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'amount-type' => $resource->amount_type, + 'amount' => $resource->amount, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\MembershipFee $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'billingConditions' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ] + ]; + } } diff --git a/app/JsonApi/Schemas/MembershipLevel.php b/app/JsonApi/Schemas/MembershipLevel.php index 1dcb647..38a4a32 100644 --- a/app/JsonApi/Schemas/MembershipLevel.php +++ b/app/JsonApi/Schemas/MembershipLevel.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class MembershipLevel extends AbstractSchema +class MembershipLevel extends SchemaProvider { /** @@ -13,18 +13,78 @@ class MembershipLevel extends AbstractSchema protected $resourceType = 'membership-levels'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\MembershipLevel $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\MembershipLevel $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'dues' => $resource->dues, + 'dues-structure' => $resource->dues_structure, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\MembershipLevel $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'memberships' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'owner' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { + return $resource->owner; + } + ], + + 'createdBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { + return $resource->createdBy; + } + ], + + 'lastUpdatedBy' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { + return $resource->lastUpdatedBy; + } + ], + + 'permissions' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ] + ]; + } } diff --git a/app/JsonApi/Schemas/OAuth2Token.php b/app/JsonApi/Schemas/OAuth2Token.php index 76f9796..b87cce9 100644 --- a/app/JsonApi/Schemas/OAuth2Token.php +++ b/app/JsonApi/Schemas/OAuth2Token.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class OAuth2Token extends AbstractSchema +class OAuth2Token extends SchemaProvider { /** @@ -13,18 +13,49 @@ class OAuth2Token extends AbstractSchema protected $resourceType = 'o-auth2-tokens'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\OAuth2Token $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\OAuth2Token $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'access-token' => $resource->access_token, + 'refresh-token' => $resource->refresh_token, + 'expires-on' => $resource->expires_on->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\OAuth2Token $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'character' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['character']), + self::DATA => function () use ($resource) { + return $resource->character; + } + ] + ]; + } } diff --git a/app/JsonApi/Schemas/Permission.php b/app/JsonApi/Schemas/Permission.php index 08a3a05..58dd9de 100644 --- a/app/JsonApi/Schemas/Permission.php +++ b/app/JsonApi/Schemas/Permission.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class Permission extends AbstractSchema +class Permission extends SchemaProvider { /** @@ -13,18 +13,45 @@ class Permission extends AbstractSchema protected $resourceType = 'permissions'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\Permission $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\Permission $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'name' => $resource->name, + 'description' => $resource->description, + 'slug' => $resource->slug, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\Permission $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'membershipLevels' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ] + ]; + } } diff --git a/app/JsonApi/Schemas/ReplacementClaim.php b/app/JsonApi/Schemas/ReplacementClaim.php index 4d785cc..edbe9ea 100644 --- a/app/JsonApi/Schemas/ReplacementClaim.php +++ b/app/JsonApi/Schemas/ReplacementClaim.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class ReplacementClaim extends AbstractSchema +class ReplacementClaim extends SchemaProvider { /** @@ -13,18 +13,73 @@ class ReplacementClaim extends AbstractSchema protected $resourceType = 'replacement-claims'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\ReplacementClaim $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\ReplacementClaim $resource + * the domain record being serialized. + * @return array */ - protected $relationships = []; + public function getAttributes($resource) + { + return [ + 'killmail-id' => $resource->killmail_id, + 'killmail-hash' => $resource->killmail_hash, + 'total' => $resource->total, + 'status' => $resource->status, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\ReplacementClaim $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'comments' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'character' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['character']), + self::DATA => function () use ($resource) { + return $resource->character; + } + ], + + 'organization' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { + return $resource->organization; + } + ], + + 'fitting' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + self::SHOW_DATA => isset($includeRelationships['fitting']), + self::DATA => function () use ($resource) { + return $resource->fitting; + } + ], + ]; + } } diff --git a/app/JsonApi/Schemas/User.php b/app/JsonApi/Schemas/User.php index c988804..b3776bd 100644 --- a/app/JsonApi/Schemas/User.php +++ b/app/JsonApi/Schemas/User.php @@ -2,9 +2,9 @@ namespace App\JsonApi\Schemas; -use CloudCreativity\LaravelJsonApi\Eloquent\AbstractSchema; +use Neomerx\JsonApi\Schema\SchemaProvider; -class User extends AbstractSchema +class User extends SchemaProvider { /** @@ -13,23 +13,59 @@ class User extends AbstractSchema protected $resourceType = 'users'; /** - * Model attributes to serialize. - * - * @var array|null + * @param \App\User $resource + * the domain record being serialized. + * @return string */ - protected $attributes = null; + public function getId($resource) + { + return (string) $resource->getKey(); + } /** - * Model relationships to serialize. - * - * @var array + * @param \App\User $resource + * the domain record being serialized. + * @return array */ - protected $relationships = [ - 'characters', - 'notifications', - 'readNotifications', - 'unreadNotifications', - ]; + public function getAttributes($resource) + { + return [ + 'email' => $resource->email, + 'settings' => $resource->settings, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), + ]; + } + /** + * @param \App\User $resource + * @param bool $isPrimary + * @param array $includeRelationships + * @return array + */ + public function getRelationships($resource, $isPrimary, array $includeRelationships) + { + return [ + 'notifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'readNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'unreadNotifications' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + + 'characters' => [ + self::SHOW_SELF => true, + self::SHOW_RELATED => true + ], + ]; + } } diff --git a/app/Membership.php b/app/Membership.php index 45104e6..fb367d7 100644 --- a/app/Membership.php +++ b/app/Membership.php @@ -20,6 +20,16 @@ * @property string last_updated_by * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo membershipLevel + * @property \Illuminate\Database\Eloquent\Relations\MorphTo organization + * @property \Illuminate\Database\Eloquent\Relations\MorphTo member + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo createdBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo lastUpdatedBy */ class Membership extends Model { diff --git a/app/MembershipFee.php b/app/MembershipFee.php index 632bab6..2a81785 100644 --- a/app/MembershipFee.php +++ b/app/MembershipFee.php @@ -17,6 +17,10 @@ * @property double amount * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\BelongsToMany billingConditions */ class MembershipFee extends Model { diff --git a/app/MembershipLevel.php b/app/MembershipLevel.php index 18b3dcb..23f2f51 100644 --- a/app/MembershipLevel.php +++ b/app/MembershipLevel.php @@ -20,6 +20,13 @@ * @property string updated_by * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\HasMany memberships + * @property \Illuminate\Database\Eloquent\Relations\MorphTo owner + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo createdBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo lastUpdatedBy + * @property \Illuminate\Database\Eloquent\Relations\BelongsToMany permissions */ class MembershipLevel extends Model { diff --git a/app/OAuth2Token.php b/app/OAuth2Token.php index 1754589..d764a64 100644 --- a/app/OAuth2Token.php +++ b/app/OAuth2Token.php @@ -14,8 +14,11 @@ * @property string access_token * @property Carbon expires_on * @property string|null refresh_token - * @property Carbon created_on - * @property Carbon updated_on + * @property Carbon created_at + * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo character */ class OAuth2Token extends Model { diff --git a/app/Permission.php b/app/Permission.php index b52ca1c..b414f93 100644 --- a/app/Permission.php +++ b/app/Permission.php @@ -4,7 +4,21 @@ use App\Traits\UuidTrait; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; +/** + * Class Permission + * + * @property string id + * @property string name + * @property string description + * @property string slug + * @property Carbon created_at + * @property Carbon updated_at + * + * Relationships + * \Illuminate\Database\Eloquent\Relations\BelongsToMany membershipLevels + */ class Permission extends Model { use UuidTrait; diff --git a/app/ReplacementClaim.php b/app/ReplacementClaim.php index 71833c0..c331cd6 100644 --- a/app/ReplacementClaim.php +++ b/app/ReplacementClaim.php @@ -2,7 +2,6 @@ namespace App; -use App\Traits\Commentable; use App\Traits\HasComments; use App\Traits\UuidTrait; use Illuminate\Database\Eloquent\Model; @@ -23,13 +22,19 @@ * @property string status * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany comments + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo character + * @property \Illuminate\Database\Eloquent\Relations\MorphTo organization + * @property \Illuminate\Database\Eloquent\Relations\BelongsTo fitting */ class ReplacementClaim extends Model { use HasComments, Notifiable, UuidTrait; /** - * Get Character that this ReplacementClaim belongs to + * Get Character that this ReplacementClaim belongs to. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -39,7 +44,7 @@ public function character() } /** - * Get Organization that this ReplacementClaim belongs to + * Get Organization that this ReplacementClaim belongs to. * * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ @@ -47,4 +52,14 @@ public function organization() { return $this->morphTo(); } + + /** + * Get relation between this replacement claim and the fitting it belongs to. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function fitting() + { + return $this->belongsTo(Fitting::class); + } } diff --git a/app/Traits/HasHandbooks.php b/app/Traits/HasHandbooks.php index 603660c..41e0f90 100644 --- a/app/Traits/HasHandbooks.php +++ b/app/Traits/HasHandbooks.php @@ -10,6 +10,11 @@ */ trait HasHandbooks { + /** + * Get relation between this model and any handbooks that it owns. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphMany + */ public function handbooks() { return $this->morphMany(Handbook::class, 'owner'); diff --git a/app/User.php b/app/User.php index 3063221..c6e00bf 100644 --- a/app/User.php +++ b/app/User.php @@ -17,6 +17,12 @@ * @property array settings * @property Carbon created_at * @property Carbon updated_at + * + * Relationships + * @property \Illuminate\Database\Eloquent\Relations\MorphMany notifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany readNotifications + * @property \Illuminate\Database\Eloquent\Relations\MorphMany unreadNotifications + * @property \Illuminate\Database\Eloquent\Relations\HasMany characters */ class User extends Authenticatable implements JWTSubject { diff --git a/database/migrations/2018_01_16_052904_create_fleet_types_table.php b/database/migrations/2018_01_16_052904_create_fleet_types_table.php index 7f57aee..b96f995 100644 --- a/database/migrations/2018_01_16_052904_create_fleet_types_table.php +++ b/database/migrations/2018_01_16_052904_create_fleet_types_table.php @@ -15,6 +15,8 @@ public function up() { Schema::create('fleet_types', function (Blueprint $table) { $table->uuid('id')->primary(); + $table->uuid('owner_id'); + $table->string('owner_type'); $table->string('name'); $table->text('description'); $table->timestamps(); From 2144008d8294b7aa14043f1bcebfd0c6b8007812 Mon Sep 17 00:00:00 2001 From: Jordan Gosney Date: Thu, 17 May 2018 21:24:18 +0000 Subject: [PATCH 5/5] Apply fixes from StyleCI --- app/Abstracts/Organization.php | 2 +- app/Alliance.php | 4 +- app/BillingCondition.php | 2 +- app/Character.php | 2 +- app/Coalition.php | 8 +- app/Comment.php | 2 +- app/Console/Kernel.php | 3 +- app/Corporation.php | 4 +- app/Discount.php | 4 +- app/Doctrine.php | 2 +- app/Exceptions/Handler.php | 9 +- app/Fitting.php | 2 +- app/Fleet.php | 4 +- app/FleetType.php | 2 +- app/Handbook.php | 2 +- .../Controllers/Auth/RegisterController.php | 18 +-- app/Http/Controllers/AuthController.php | 10 +- app/Http/Controllers/CharacterController.php | 7 +- app/Http/Controllers/Controller.php | 15 +-- app/Http/Kernel.php | 10 +- app/Http/Middleware/EveCallbackAuth.php | 5 +- .../Middleware/RedirectIfAuthenticated.php | 7 +- app/Http/Middleware/TrustProxies.php | 2 +- app/Interfaces/HasTotal.php | 6 +- app/Invoice.php | 16 +-- app/InvoiceItem.php | 4 +- app/Jobs/RefreshMembers.php | 4 +- app/JsonApi/Adapters/BillingCondition.php | 2 +- app/JsonApi/Adapters/Comment.php | 2 +- app/JsonApi/Adapters/Discount.php | 2 +- app/JsonApi/Adapters/Fitting.php | 2 +- app/JsonApi/Adapters/FleetType.php | 2 +- app/JsonApi/Adapters/Handbook.php | 2 +- app/JsonApi/Adapters/InvoiceItem.php | 2 +- app/JsonApi/Adapters/Membership.php | 2 +- app/JsonApi/Adapters/MembershipLevel.php | 2 +- app/JsonApi/Adapters/OAuth2Token.php | 2 +- app/JsonApi/Adapters/Permission.php | 2 +- app/JsonApi/Authorizers/DefaultAuthorizer.php | 62 +++++----- app/JsonApi/FiltersResources.php | 18 +-- app/JsonApi/Schemas/Alliance.php | 105 ++++++++--------- app/JsonApi/Schemas/BillingCondition.php | 34 +++--- app/JsonApi/Schemas/Character.php | 73 ++++++------ app/JsonApi/Schemas/Coalition.php | 100 ++++++++-------- app/JsonApi/Schemas/Comment.php | 25 ++-- app/JsonApi/Schemas/Corporation.php | 109 +++++++++--------- app/JsonApi/Schemas/Discount.php | 35 +++--- app/JsonApi/Schemas/Doctrine.php | 49 ++++---- app/JsonApi/Schemas/Fitting.php | 45 ++++---- app/JsonApi/Schemas/Fleet.php | 73 ++++++------ app/JsonApi/Schemas/FleetType.php | 33 +++--- app/JsonApi/Schemas/Handbook.php | 53 ++++----- app/JsonApi/Schemas/Invoice.php | 69 +++++------ app/JsonApi/Schemas/InvoiceItem.php | 37 +++--- app/JsonApi/Schemas/Membership.php | 69 +++++------ app/JsonApi/Schemas/MembershipFee.php | 33 +++--- app/JsonApi/Schemas/MembershipLevel.php | 57 ++++----- app/JsonApi/Schemas/OAuth2Token.php | 31 ++--- app/JsonApi/Schemas/Permission.php | 27 ++--- app/JsonApi/Schemas/ReplacementClaim.php | 51 ++++---- app/JsonApi/Schemas/User.php | 33 +++--- app/JsonApi/Validators/Alliance.php | 4 +- app/JsonApi/Validators/BillingCondition.php | 4 +- app/JsonApi/Validators/Character.php | 10 +- app/JsonApi/Validators/Coalition.php | 4 +- app/JsonApi/Validators/Comment.php | 4 +- app/JsonApi/Validators/Corporation.php | 4 +- app/JsonApi/Validators/Discount.php | 4 +- app/JsonApi/Validators/Doctrine.php | 4 +- app/JsonApi/Validators/Fitting.php | 4 +- app/JsonApi/Validators/Fleet.php | 4 +- app/JsonApi/Validators/FleetType.php | 4 +- app/JsonApi/Validators/Handbook.php | 4 +- app/JsonApi/Validators/Invoice.php | 4 +- app/JsonApi/Validators/InvoiceItem.php | 4 +- app/JsonApi/Validators/Membership.php | 4 +- app/JsonApi/Validators/MembershipFee.php | 4 +- app/JsonApi/Validators/MembershipLevel.php | 4 +- app/JsonApi/Validators/OAuth2Token.php | 4 +- app/JsonApi/Validators/Permission.php | 4 +- app/JsonApi/Validators/ReplacementClaim.php | 4 +- app/JsonApi/Validators/User.php | 10 +- app/Listeners/BubbleNotification.php | 8 +- app/Membership.php | 12 +- app/MembershipFee.php | 4 +- app/MembershipLevel.php | 4 +- app/Notifications/Invoice/CommentPosted.php | 13 ++- app/Notifications/Invoice/Created.php | 23 ++-- .../Invoice/ForcePaymentPosted.php | 14 ++- app/Notifications/Invoice/Fulfilled.php | 14 ++- app/Notifications/Invoice/PaymentPosted.php | 14 ++- app/Notifications/Invoice/StateChanged.php | 14 ++- app/Notifications/Invoice/Updated.php | 13 ++- app/Notifications/Membership/Created.php | 14 ++- app/Notifications/Membership/Deleted.php | 14 ++- app/Notifications/Membership/Updated.php | 14 ++- .../ReplacementClaim/Approved.php | 14 ++- .../ReplacementClaim/Created.php | 14 ++- .../ReplacementClaim/Dispersed.php | 14 ++- app/OAuth2Token.php | 4 +- app/Permission.php | 2 +- app/Policies/CoalitionPolicy.php | 20 ++-- app/Providers/AuthServiceProvider.php | 1 - app/Providers/BroadcastServiceProvider.php | 2 +- app/Providers/EventServiceProvider.php | 7 +- app/Providers/RouteServiceProvider.php | 2 +- app/ReplacementClaim.php | 4 +- app/Traits/BubblesNotifications.php | 6 +- app/Traits/HasComments.php | 4 +- app/Traits/HasHandbooks.php | 5 +- app/Traits/HasMembers.php | 10 +- app/Traits/HasSRP.php | 4 +- app/Traits/IsMember.php | 6 +- app/Traits/IssuesInvoices.php | 15 +-- app/Traits/ModifiesAmounts.php | 21 ++-- app/Traits/ReceivesInvoices.php | 15 +-- app/Traits/UuidTrait.php | 4 +- app/User.php | 8 +- config/app.php | 64 +++++----- config/auth.php | 12 +- config/broadcasting.php | 12 +- config/cache.php | 16 +-- config/database.php | 68 +++++------ config/filesystems.php | 10 +- config/hashing.php | 2 +- config/json-api-v1.php | 46 ++++---- config/logging.php | 26 ++--- config/mail.php | 2 +- config/queue.php | 24 ++-- config/services.php | 6 +- database/factories/UserFactory.php | 6 +- .../2014_10_12_000000_create_users_table.php | 4 +- ...12_100000_create_password_resets_table.php | 4 +- ...8_01_05_183021_create_characters_table.php | 4 +- ...8_01_05_185425_create_coalitions_table.php | 4 +- ...18_01_05_185749_create_handbooks_table.php | 4 +- ...01_05_195510_create_corporations_table.php | 4 +- ...18_01_05_195519_create_alliances_table.php | 4 +- ..._01_05_195756_create_memberships_table.php | 4 +- ..._200853_create_membership_levels_table.php | 4 +- ...05_201821_create_membership_fees_table.php | 4 +- ...018_01_08_200228_create_invoices_table.php | 4 +- ...1_08_200715_create_invoice_items_table.php | 4 +- ...1_08_204311_create_notifications_table.php | 4 +- ...18_01_08_214910_create_discounts_table.php | 4 +- ...215257_create_billing_conditions_table.php | 4 +- ...billing_condition_membership_fee_table.php | 4 +- ...018_01_11_235330_create_comments_table.php | 4 +- ...18_01_12_003129_create_doctrines_table.php | 4 +- ...003242_create_replacement_claims_table.php | 4 +- ...3_001951_create_doctrine_fitting_table.php | 4 +- ...018_01_13_002004_create_fittings_table.php | 4 +- ..._01_15_222547_create_permissions_table.php | 4 +- ...eate_membership_level_permission_table.php | 4 +- .../2018_01_16_052843_create_fleets_table.php | 4 +- ..._01_16_052904_create_fleet_types_table.php | 4 +- ..._23_221140_create_o_auth2_tokens_table.php | 4 +- database/seeds/PermissionsTableSeeder.php | 32 ++--- public/index.php | 4 +- resources/lang/en/auth.php | 2 +- resources/lang/en/pagination.php | 2 +- resources/lang/en/passwords.php | 8 +- routes/api.php | 11 +- server.php | 4 +- tests/CreatesApplication.php | 2 +- tests/Feature/ExampleTest.php | 1 - tests/Unit/ExampleTest.php | 1 - 167 files changed, 1190 insertions(+), 1127 deletions(-) diff --git a/app/Abstracts/Organization.php b/app/Abstracts/Organization.php index 0d64538..1134fea 100644 --- a/app/Abstracts/Organization.php +++ b/app/Abstracts/Organization.php @@ -21,4 +21,4 @@ public function fleetTypes() { return $this->morphMany(FleetType::class, 'owner'); } -} \ No newline at end of file +} diff --git a/app/Alliance.php b/app/Alliance.php index fc0d732..da9cff2 100644 --- a/app/Alliance.php +++ b/app/Alliance.php @@ -11,7 +11,7 @@ use Illuminate\Support\Carbon; /** - * Class Alliance + * Class Alliance. * * @property string id * @property int api_id @@ -48,7 +48,7 @@ class Alliance extends Organization use UuidTrait, HasSRP, ReceivesInvoices, IssuesInvoices, Notifiable; protected $casts = [ - 'settings' => 'array' + 'settings' => 'array', ]; /** diff --git a/app/BillingCondition.php b/app/BillingCondition.php index d2775c3..66d022c 100644 --- a/app/BillingCondition.php +++ b/app/BillingCondition.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class BillingCondition + * Class BillingCondition. * * @property string id * @property string owner_id diff --git a/app/Character.php b/app/Character.php index b86c42a..e6216ca 100644 --- a/app/Character.php +++ b/app/Character.php @@ -11,7 +11,7 @@ use Illuminate\Support\Carbon; /** - * Class Character + * Class Character. * * @property string id * @property int user_id diff --git a/app/Coalition.php b/app/Coalition.php index e72f1c8..97f797f 100644 --- a/app/Coalition.php +++ b/app/Coalition.php @@ -10,7 +10,7 @@ use Illuminate\Support\Carbon; /** - * Class Coalition + * Class Coalition. * * @property string id * @property int leader_character_id @@ -50,7 +50,7 @@ class Coalition extends Organization use UuidTrait, HasSRP, ReceivesInvoices, IssuesInvoices; protected $casts = [ - 'settings' => 'array' + 'settings' => 'array', ]; public function receivedInvoiceSubscribers() @@ -68,7 +68,7 @@ public function receivedInvoiceSubscribers() } /** - * Get relation between this coalition and the character that is designated as the leader + * Get relation between this coalition and the character that is designated as the leader. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -78,7 +78,7 @@ public function leader() } /** - * Get relation between this coalition and any alliances that are members of it + * Get relation between this coalition and any alliances that are members of it. * * @return \Illuminate\Database\Eloquent\Relations\MorphMany */ diff --git a/app/Comment.php b/app/Comment.php index 81e1a6e..84fbc2a 100644 --- a/app/Comment.php +++ b/app/Comment.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model; /** - * Class Comment + * Class Comment. * * @property string id * @property string commentable_id diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8c5158..29934ca 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule + * * @return void */ protected function schedule(Schedule $schedule) diff --git a/app/Corporation.php b/app/Corporation.php index b0f222e..9bfa328 100644 --- a/app/Corporation.php +++ b/app/Corporation.php @@ -11,7 +11,7 @@ use Illuminate\Support\Carbon; /** - * Class Corporation + * Class Corporation. * * @property string id * @property int api_id @@ -54,7 +54,7 @@ protected function getBubbleToModels(Notification $notification) } protected $casts = [ - 'settings' => 'array' + 'settings' => 'array', ]; /** diff --git a/app/Discount.php b/app/Discount.php index b89f512..2b047bf 100644 --- a/app/Discount.php +++ b/app/Discount.php @@ -8,14 +8,14 @@ use Illuminate\Support\Carbon; /** - * Class Discount + * Class Discount. * * @property string id * @property string owner_id * @property string owner_type * @property string billing_condition_id * @property string amount_type - * @property double amount + * @property float amount * @property Carbon created_at * @property Carbon updated_at * diff --git a/app/Doctrine.php b/app/Doctrine.php index 2b0823a..05cd468 100644 --- a/app/Doctrine.php +++ b/app/Doctrine.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class Doctrine + * Class Doctrine. * * @property string id * @property string owner_id diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b958543..3dab915 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -32,8 +32,10 @@ class Handler extends ExceptionHandler * * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * - * @param \Exception $exception + * @param \Exception $exception + * * @throws \Exception + * * @return void */ public function report(Exception $exception) @@ -44,8 +46,9 @@ public function report(Exception $exception) /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Exception $exception + * @param \Illuminate\Http\Request $request + * @param \Exception $exception + * * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) diff --git a/app/Fitting.php b/app/Fitting.php index 8796713..4c78e37 100644 --- a/app/Fitting.php +++ b/app/Fitting.php @@ -8,7 +8,7 @@ use Illuminate\Support\Carbon; /** - * Class Fitting + * Class Fitting. * * @property string id * @property string owner_id diff --git a/app/Fleet.php b/app/Fleet.php index 81c5643..57f8764 100644 --- a/app/Fleet.php +++ b/app/Fleet.php @@ -10,7 +10,7 @@ use Illuminate\Support\Carbon; /** - * Class Fleet + * Class Fleet. * * @property string id * @property string fleet_type_id @@ -43,7 +43,7 @@ class Fleet extends Model 'start_time', 'end_time', 'created_at', - 'updated_at' + 'updated_at', ]; /** diff --git a/app/FleetType.php b/app/FleetType.php index da1b583..a3de76c 100644 --- a/app/FleetType.php +++ b/app/FleetType.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class FleetType + * Class FleetType. * * @property string id * @property string name diff --git a/app/Handbook.php b/app/Handbook.php index a03e870..7dec96f 100644 --- a/app/Handbook.php +++ b/app/Handbook.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class Handbook + * Class Handbook. * * @property string id * @property string owner_id diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index f77265a..b8fc934 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers\Auth; -use App\User; use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\Validator; +use App\User; use Illuminate\Foundation\Auth\RegistersUsers; +use Illuminate\Support\Facades\Validator; class RegisterController extends Controller { @@ -42,14 +42,15 @@ public function __construct() /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data + * * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ - 'name' => 'required|string|max:255', - 'email' => 'required|string|email|max:255|unique:users', + 'name' => 'required|string|max:255', + 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:6|confirmed', ]); } @@ -57,14 +58,15 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data + * * @return \App\User */ protected function create(array $data) { return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], + 'name' => $data['name'], + 'email' => $data['email'], 'password' => bcrypt($data['password']), ]); } diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 331ec5f..4a17b7e 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -23,7 +23,7 @@ public function login() { $credentials = request(['email', 'password']); - if (! $token = auth()->attempt($credentials)) { + if (!$token = auth()->attempt($credentials)) { return response()->json(['error' => 'Unauthorized'], 401); } @@ -65,7 +65,7 @@ public function refresh() /** * Get the token array structure. * - * @param string $token + * @param string $token * * @return \Illuminate\Http\JsonResponse */ @@ -73,8 +73,8 @@ protected function respondWithToken($token) { return response()->json([ 'access_token' => $token, - 'token_type' => 'bearer', - 'expires_in' => auth()->factory()->getTTL() * 60 + 'token_type' => 'bearer', + 'expires_in' => auth()->factory()->getTTL() * 60, ]); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/CharacterController.php b/app/Http/Controllers/CharacterController.php index 139d264..cb9f883 100644 --- a/app/Http/Controllers/CharacterController.php +++ b/app/Http/Controllers/CharacterController.php @@ -12,17 +12,18 @@ class CharacterController extends Controller /** * Store a newly created resource in storage. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return */ public function callback(Request $request) { - $token = new OAuth2Token; + $token = new OAuth2Token(); $token->access_token = $request->get('access_token'); $token->refresh_token = $request->get('refresh_token'); $token->expires_on = $request->get('expires_on'); - $character = new Character; + $character = new Character(); $character->eve_id = $request->get('id'); $character->name = $request->get('name'); $character->user()->associate(Auth::user()); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index da82199..881b0e1 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; -use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; +use Illuminate\Routing\Controller as BaseController; class Controller extends BaseController { @@ -14,13 +14,14 @@ class Controller extends BaseController protected function formatValidationErrors(\Illuminate\Contracts\Validation\Validator $validator) { $status = 422; + return [ - "message" => $status . " error", - "errors" => [ - "message" => $validator->getMessageBag()->first(), - "info" => [$validator->getMessageBag()->keys()[0]], + 'message' => $status.' error', + 'errors' => [ + 'message' => $validator->getMessageBag()->first(), + 'info' => [$validator->getMessageBag()->keys()[0]], ], - "status_code" => $status + 'status_code' => $status, ]; } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index b7e5230..6f02622 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -51,12 +51,12 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, // custom middleware 'auth.callback' => Middleware\EveCallbackAuth::class, diff --git a/app/Http/Middleware/EveCallbackAuth.php b/app/Http/Middleware/EveCallbackAuth.php index 2b2d96b..18dc84a 100644 --- a/app/Http/Middleware/EveCallbackAuth.php +++ b/app/Http/Middleware/EveCallbackAuth.php @@ -9,8 +9,9 @@ class EveCallbackAuth /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e4cec9c..afe1c26 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -10,9 +10,10 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 23a027e..a9682c1 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware; -use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; +use Illuminate\Http\Request; class TrustProxies extends Middleware { diff --git a/app/Interfaces/HasTotal.php b/app/Interfaces/HasTotal.php index fae877c..9321e91 100644 --- a/app/Interfaces/HasTotal.php +++ b/app/Interfaces/HasTotal.php @@ -3,13 +3,11 @@ * Created by IntelliJ IDEA. * User: mac * Date: 1/8/18 - * Time: 2:31 PM + * Time: 2:31 PM. */ namespace App\Interfaces; - interface HasTotal { - -} \ No newline at end of file +} diff --git a/app/Invoice.php b/app/Invoice.php index fd48bb1..6835d10 100644 --- a/app/Invoice.php +++ b/app/Invoice.php @@ -11,7 +11,7 @@ use Illuminate\Notifications\Notifiable; /** - * Class Invoice + * Class Invoice. * * @property string id * @property string owner_id @@ -21,7 +21,7 @@ * @property string code * @property string title * @property string status - * @property double total + * @property float total * @property Carbon due_date * @property Carbon hard_due_date * @property Carbon created_at @@ -53,11 +53,11 @@ class Invoice extends Model 'created_at', 'updated_at', 'due_date', - 'hard_due_date' + 'hard_due_date', ]; /** - * Get the issuer of the invoice + * Get the issuer of the invoice. * * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ @@ -67,7 +67,7 @@ public function issuer() } /** - * Get the recipient of the invoice + * Get the recipient of the invoice. * * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ @@ -77,7 +77,7 @@ public function recipient() } /** - * Get any invoice items attached to the invoice + * Get any invoice items attached to the invoice. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ @@ -87,7 +87,7 @@ public function items() } /** - * Get any payments posted for the invoice + * Get any payments posted for the invoice. * * @return mixed */ @@ -97,7 +97,7 @@ public function payments() } /** - * Get the amount still owed on the invoice + * Get the amount still owed on the invoice. * * @return float */ diff --git a/app/InvoiceItem.php b/app/InvoiceItem.php index 15a6fe2..ae21637 100644 --- a/app/InvoiceItem.php +++ b/app/InvoiceItem.php @@ -8,13 +8,13 @@ use Illuminate\Database\Eloquent\Model; /** - * Class InvoiceItem + * Class InvoiceItem. * * @property string id * @property string name * @property string description * @property int quantity - * @property double cost + * @property float cost * @property Carbon created_at * @property Carbon updated_at * diff --git a/app/Jobs/RefreshMembers.php b/app/Jobs/RefreshMembers.php index 0cc11af..dccce90 100644 --- a/app/Jobs/RefreshMembers.php +++ b/app/Jobs/RefreshMembers.php @@ -3,10 +3,10 @@ namespace App\Jobs; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; class RefreshMembers implements ShouldQueue { diff --git a/app/JsonApi/Adapters/BillingCondition.php b/app/JsonApi/Adapters/BillingCondition.php index cf18370..4f5c55a 100644 --- a/app/JsonApi/Adapters/BillingCondition.php +++ b/app/JsonApi/Adapters/BillingCondition.php @@ -25,7 +25,7 @@ class BillingCondition extends AbstractAdapter protected $relationships = [ 'owner', 'discounts', - 'membershipFees' + 'membershipFees', ]; /** diff --git a/app/JsonApi/Adapters/Comment.php b/app/JsonApi/Adapters/Comment.php index 448fb36..89f9302 100644 --- a/app/JsonApi/Adapters/Comment.php +++ b/app/JsonApi/Adapters/Comment.php @@ -25,7 +25,7 @@ class Comment extends AbstractAdapter protected $relationships = [ 'character', 'comments', - 'commentable' + 'commentable', ]; /** diff --git a/app/JsonApi/Adapters/Discount.php b/app/JsonApi/Adapters/Discount.php index a4726a3..ad839eb 100644 --- a/app/JsonApi/Adapters/Discount.php +++ b/app/JsonApi/Adapters/Discount.php @@ -24,7 +24,7 @@ class Discount extends AbstractAdapter */ protected $relationships = [ 'owner', - 'billingCondition' + 'billingCondition', ]; /** diff --git a/app/JsonApi/Adapters/Fitting.php b/app/JsonApi/Adapters/Fitting.php index 1ec6397..9c0c893 100644 --- a/app/JsonApi/Adapters/Fitting.php +++ b/app/JsonApi/Adapters/Fitting.php @@ -25,7 +25,7 @@ class Fitting extends AbstractAdapter protected $relationships = [ 'owner', 'doctrine', - 'replacementClaims' + 'replacementClaims', ]; /** diff --git a/app/JsonApi/Adapters/FleetType.php b/app/JsonApi/Adapters/FleetType.php index 949287b..c59a8ba 100644 --- a/app/JsonApi/Adapters/FleetType.php +++ b/app/JsonApi/Adapters/FleetType.php @@ -23,7 +23,7 @@ class FleetType extends AbstractAdapter * @var array */ protected $relationships = [ - 'fleets' + 'fleets', ]; /** diff --git a/app/JsonApi/Adapters/Handbook.php b/app/JsonApi/Adapters/Handbook.php index 33f43a7..a975638 100644 --- a/app/JsonApi/Adapters/Handbook.php +++ b/app/JsonApi/Adapters/Handbook.php @@ -25,7 +25,7 @@ class Handbook extends AbstractAdapter protected $relationships = [ 'owner', 'createdBy', - 'lastUpdatedBy' + 'lastUpdatedBy', ]; /** diff --git a/app/JsonApi/Adapters/InvoiceItem.php b/app/JsonApi/Adapters/InvoiceItem.php index 270e0e8..63dddaa 100644 --- a/app/JsonApi/Adapters/InvoiceItem.php +++ b/app/JsonApi/Adapters/InvoiceItem.php @@ -23,7 +23,7 @@ class InvoiceItem extends AbstractAdapter * @var array */ protected $relationships = [ - 'comments' + 'comments', ]; /** diff --git a/app/JsonApi/Adapters/Membership.php b/app/JsonApi/Adapters/Membership.php index 8845e93..054af72 100644 --- a/app/JsonApi/Adapters/Membership.php +++ b/app/JsonApi/Adapters/Membership.php @@ -18,7 +18,7 @@ class Membership extends AbstractAdapter protected $attributes = []; protected $guarded = [ - 'createdBy' + 'createdBy', ]; /** diff --git a/app/JsonApi/Adapters/MembershipLevel.php b/app/JsonApi/Adapters/MembershipLevel.php index 9a300c6..886979d 100644 --- a/app/JsonApi/Adapters/MembershipLevel.php +++ b/app/JsonApi/Adapters/MembershipLevel.php @@ -18,7 +18,7 @@ class MembershipLevel extends AbstractAdapter protected $attributes = []; protected $guarded = [ - 'createdBy' + 'createdBy', ]; /** diff --git a/app/JsonApi/Adapters/OAuth2Token.php b/app/JsonApi/Adapters/OAuth2Token.php index f43c385..7a1c6ae 100644 --- a/app/JsonApi/Adapters/OAuth2Token.php +++ b/app/JsonApi/Adapters/OAuth2Token.php @@ -23,7 +23,7 @@ class OAuth2Token extends AbstractAdapter * @var array */ protected $relationships = [ - 'character' + 'character', ]; /** diff --git a/app/JsonApi/Adapters/Permission.php b/app/JsonApi/Adapters/Permission.php index 641bc2b..921f2fa 100644 --- a/app/JsonApi/Adapters/Permission.php +++ b/app/JsonApi/Adapters/Permission.php @@ -23,7 +23,7 @@ class Permission extends AbstractAdapter * @var array */ protected $relationships = [ - 'membershipLevels' + 'membershipLevels', ]; /** diff --git a/app/JsonApi/Authorizers/DefaultAuthorizer.php b/app/JsonApi/Authorizers/DefaultAuthorizer.php index 3581b79..60c6a01 100644 --- a/app/JsonApi/Authorizers/DefaultAuthorizer.php +++ b/app/JsonApi/Authorizers/DefaultAuthorizer.php @@ -9,17 +9,18 @@ class DefaultAuthorizer extends AbstractAuthorizer { - /** * Authorize a resource index request. * - * @param string $type - * the domain record type. + * @param string $type + * the domain record type. * @param Request $request - * the inbound request. - * @return void + * the inbound request. + * * @throws AuthenticationException|AuthorizationException - * if the request is not authorized. + * if the request is not authorized. + * + * @return void */ public function index($type, $request) { @@ -29,13 +30,15 @@ public function index($type, $request) /** * Authorize a resource create request. * - * @param string $type - * the domain record type. + * @param string $type + * the domain record type. * @param Request $request - * the inbound request. - * @return void + * the inbound request. + * * @throws AuthenticationException|AuthorizationException - * if the request is not authorized. + * if the request is not authorized. + * + * @return void */ public function create($type, $request) { @@ -45,13 +48,15 @@ public function create($type, $request) /** * Authorize a resource read request. * - * @param object $record - * the domain record. + * @param object $record + * the domain record. * @param Request $request - * the inbound request. - * @return void + * the inbound request. + * * @throws AuthenticationException|AuthorizationException - * if the request is not authorized. + * if the request is not authorized. + * + * @return void */ public function read($record, $request) { @@ -61,13 +66,15 @@ public function read($record, $request) /** * Authorize a resource update request. * - * @param object $record - * the domain record. + * @param object $record + * the domain record. * @param Request $request - * the inbound request. - * @return void + * the inbound request. + * * @throws AuthenticationException|AuthorizationException - * if the request is not authorized. + * if the request is not authorized. + * + * @return void */ public function update($record, $request) { @@ -77,17 +84,18 @@ public function update($record, $request) /** * Authorize a resource read request. * - * @param object $record - * the domain record. + * @param object $record + * the domain record. * @param Request $request - * the inbound request. - * @return void + * the inbound request. + * * @throws AuthenticationException|AuthorizationException - * if the request is not authorized. + * if the request is not authorized. + * + * @return void */ public function delete($record, $request) { $this->can('delete', $record); } - } diff --git a/app/JsonApi/FiltersResources.php b/app/JsonApi/FiltersResources.php index e2661a8..e023d2b 100644 --- a/app/JsonApi/FiltersResources.php +++ b/app/JsonApi/FiltersResources.php @@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Schema; /** - * Trait FiltersResources + * Trait FiltersResources. * * @property Model model */ @@ -31,13 +31,13 @@ private function doFilter(Builder $query, $filter, $value) } } elseif (strtolower($filter) === 'or') { foreach ($value as $k => $v) { - $query->orWhere(function($query) use ($k, $v) { + $query->orWhere(function ($query) use ($k, $v) { $this->doFilter($query, $k, $v); }); } } elseif (strtolower($filter) === 'and') { foreach ($value as $k => $v) { - $query->where(function($query) use ($k, $v) { + $query->where(function ($query) use ($k, $v) { $this->doFilter($query, $k, $v); }); } @@ -54,15 +54,15 @@ private function doFilter(Builder $query, $filter, $value) } else { throw new ValidationException(Error::create([ 'status' => 422, - 'title' => "Unknown value passed for filter", + 'title' => 'Unknown value passed for filter', 'detail' => "Unknown value {{$name}}", - 'source' => ['parameter' => "filter[{$name}]=$value"]])); + 'source' => ['parameter' => "filter[{$name}]=$value"], ])); } if (!Schema::connection($this->model->getConnectionName())->hasColumn($this->model->getTable(), $name)) { throw new ValidationException(Error::create([ 'status' => 422, - 'title' => "Unknown key passed for filter: {$name}"])); + 'title' => "Unknown key passed for filter: {$name}", ])); } $this->applyFilter($query, $operator, $name, $value); @@ -74,7 +74,7 @@ private function applyFilter(Builder $filterQuery, $operator, $name, $value) switch ($operator) { case null: case 'is': - if(in_array(strtolower($value),['true', 'false', '0', '1'])) { + if (in_array(strtolower($value), ['true', 'false', '0', '1'])) { $filterQuery->where($name, filter_var($value, FILTER_VALIDATE_BOOLEAN)); } else { $filterQuery->where($name, $value); @@ -101,7 +101,7 @@ private function applyFilter(Builder $filterQuery, $operator, $name, $value) $filterQuery->whereNull($name); break; case 'null': - if (filter_var($value,FILTER_VALIDATE_BOOLEAN)) { + if (filter_var($value, FILTER_VALIDATE_BOOLEAN)) { $filterQuery->whereNull($name); } else { $filterQuery->whereNotNull($name); @@ -146,4 +146,4 @@ protected function with(Builder $query, Collection $includedResources) { $query->with($includedResources); } -} \ No newline at end of file +} diff --git a/app/JsonApi/Schemas/Alliance.php b/app/JsonApi/Schemas/Alliance.php index 616ce2f..cc8170d 100644 --- a/app/JsonApi/Schemas/Alliance.php +++ b/app/JsonApi/Schemas/Alliance.php @@ -6,7 +6,6 @@ class Alliance extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Alliance extends SchemaProvider /** * @param \App\Alliance $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,15 +24,16 @@ public function getId($resource) /** * @param \App\Alliance $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'api-id' => $resource->api_id, - 'name' => $resource->name, - 'settings' => $resource->settings, + 'api-id' => $resource->api_id, + 'name' => $resource->name, + 'settings' => $resource->settings, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -40,117 +41,117 @@ public function getAttributes($resource) /** * @param \App\Alliance $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'handbooks' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'members' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultMembershipLevel' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'membershipLevels' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'memberships' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'claims' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'invoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'issuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'coalition' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['coalition']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['coalition']), + self::DATA => function () use ($resource) { return $resource->coalition; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/BillingCondition.php b/app/JsonApi/Schemas/BillingCondition.php index cbc005d..25ad720 100644 --- a/app/JsonApi/Schemas/BillingCondition.php +++ b/app/JsonApi/Schemas/BillingCondition.php @@ -6,7 +6,6 @@ class BillingCondition extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class BillingCondition extends SchemaProvider /** * @param \App\BillingCondition $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,47 +24,47 @@ public function getId($resource) /** * @param \App\BillingCondition $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'type' => $resource->type, - 'quantity' => $resource->quantity, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'type' => $resource->type, + 'quantity' => $resource->quantity, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\BillingCondition $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true, + self::SHOW_DATA => true, ], 'discounts' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, ], 'membership-fees' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - ] + ], ]; } - } - diff --git a/app/JsonApi/Schemas/Character.php b/app/JsonApi/Schemas/Character.php index bd881a8..7b1a1a6 100644 --- a/app/JsonApi/Schemas/Character.php +++ b/app/JsonApi/Schemas/Character.php @@ -6,7 +6,6 @@ class Character extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Character extends SchemaProvider /** * @param \App\Character $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,14 +24,15 @@ public function getId($resource) /** * @param \App\Character $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, - 'eve-id' => $resource->eve_id, + 'name' => $resource->name, + 'eve-id' => $resource->eve_id, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -39,83 +40,83 @@ public function getAttributes($resource) /** * @param \App\Character $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'memberships' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'claims' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'invoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'user' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'token' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'corporation' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], ]; } } - diff --git a/app/JsonApi/Schemas/Coalition.php b/app/JsonApi/Schemas/Coalition.php index 4a3ac5a..71db355 100644 --- a/app/JsonApi/Schemas/Coalition.php +++ b/app/JsonApi/Schemas/Coalition.php @@ -6,7 +6,6 @@ class Coalition extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Coalition extends SchemaProvider /** * @param \App\Coalition $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,128 +24,130 @@ public function getId($resource) /** * @param \App\Coalition $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'logo' => $resource->logo, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'logo' => $resource->logo, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Coalition $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'handbooks' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'members' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultMembershipLevel' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'membershipLevels' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'memberships' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'claims' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'invoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'issuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'leader' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true + self::SHOW_DATA => true, ], ]; } diff --git a/app/JsonApi/Schemas/Comment.php b/app/JsonApi/Schemas/Comment.php index ad55b58..5659584 100644 --- a/app/JsonApi/Schemas/Comment.php +++ b/app/JsonApi/Schemas/Comment.php @@ -6,7 +6,6 @@ class Comment extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Comment extends SchemaProvider /** * @param \App\Comment $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,13 +24,14 @@ public function getId($resource) /** * @param \App\Comment $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'text' => $resource->text, + 'text' => $resource->text, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -38,25 +39,25 @@ public function getAttributes($resource) /** * @param \App\Comment $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'character' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true + self::SHOW_DATA => true, ], 'commentable' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true - ] + self::SHOW_DATA => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Corporation.php b/app/JsonApi/Schemas/Corporation.php index b4d0faf..f428fd8 100644 --- a/app/JsonApi/Schemas/Corporation.php +++ b/app/JsonApi/Schemas/Corporation.php @@ -6,7 +6,6 @@ class Corporation extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Corporation extends SchemaProvider /** * @param \App\Corporation $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,136 +24,137 @@ public function getId($resource) /** * @param \App\Corporation $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'api-id' => $resource->api_id, - 'name' => $resource->name, + 'api-id' => $resource->api_id, + 'name' => $resource->name, 'default-membership-level' => $resource->default_membership_level, - 'settings' => $resource->settings, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'settings' => $resource->settings, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Corporation $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'handbooks' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'members' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultMembershipLevel' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'membershipLevels' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'memberships' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'claims' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'invoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'issuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fulfilledIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'overdueIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'pendingIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'defaultIssuedInvoices' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'alliance' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => true + self::SHOW_DATA => true, ], 'characters' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true - ] + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Discount.php b/app/JsonApi/Schemas/Discount.php index 4f0308e..700db6e 100644 --- a/app/JsonApi/Schemas/Discount.php +++ b/app/JsonApi/Schemas/Discount.php @@ -6,7 +6,6 @@ class Discount extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Discount extends SchemaProvider /** * @param \App\Discount $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,46 +24,47 @@ public function getId($resource) /** * @param \App\Discount $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ 'amount-type' => $resource->amount_type, - 'amount' => $resource->amount, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'amount' => $resource->amount, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Discount $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'billingCondition' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['billing-condition']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['billing-condition']), + self::DATA => function () use ($resource) { return $resource->billingCondition; - } + }, ], ]; } } - diff --git a/app/JsonApi/Schemas/Doctrine.php b/app/JsonApi/Schemas/Doctrine.php index ab53bbd..68ec185 100644 --- a/app/JsonApi/Schemas/Doctrine.php +++ b/app/JsonApi/Schemas/Doctrine.php @@ -6,7 +6,6 @@ class Doctrine extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Doctrine extends SchemaProvider /** * @param \App\Doctrine $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,61 +24,62 @@ public function getId($resource) /** * @param \App\Doctrine $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'priority' => $resource->priority, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'priority' => $resource->priority, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Doctrine $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'fittings' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'createdBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['createdBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { return $resource->createdBy; - } + }, ], 'lastUpdatedBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { return $resource->lastUpdatedBy; - } + }, ], ]; } } - diff --git a/app/JsonApi/Schemas/Fitting.php b/app/JsonApi/Schemas/Fitting.php index 8785c90..e6155b8 100644 --- a/app/JsonApi/Schemas/Fitting.php +++ b/app/JsonApi/Schemas/Fitting.php @@ -6,7 +6,6 @@ class Fitting extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Fitting extends SchemaProvider /** * @param \App\Fitting $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,57 +24,58 @@ public function getId($resource) /** * @param \App\Fitting $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'api-id' => $resource->api_id, - 'name' => $resource->name, + 'api-id' => $resource->api_id, + 'name' => $resource->name, 'description' => $resource->description, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Fitting $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'doctrine' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['doctrine']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['doctrine']), + self::DATA => function () use ($resource) { return $resource->doctrine; - } + }, ], 'replacementClaims' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], ]; } } - diff --git a/app/JsonApi/Schemas/Fleet.php b/app/JsonApi/Schemas/Fleet.php index 4fbce3e..d64c247 100644 --- a/app/JsonApi/Schemas/Fleet.php +++ b/app/JsonApi/Schemas/Fleet.php @@ -6,7 +6,6 @@ class Fleet extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Fleet extends SchemaProvider /** * @param \App\Fleet $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,86 +24,87 @@ public function getId($resource) /** * @param \App\Fleet $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'title' => $resource->title, + 'title' => $resource->title, 'description' => $resource->description, - 'start-time' => $resource->start_time->toIso8601String(), - 'end-time' => $resource->end_time->toIso8601String(), - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'start-time' => $resource->start_time->toIso8601String(), + 'end-time' => $resource->end_time->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Fleet $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'fleetType' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['fleetType']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['fleetType']), + self::DATA => function () use ($resource) { return $resource->fleetType; - } + }, ], 'organization' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['organization']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { return $resource->organization; - } + }, ], 'createdBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['createdBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { return $resource->createdBy; - } + }, ], 'lastUpdatedBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { return $resource->lastUpdatedBy; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/FleetType.php b/app/JsonApi/Schemas/FleetType.php index d3a9454..5c85a4e 100644 --- a/app/JsonApi/Schemas/FleetType.php +++ b/app/JsonApi/Schemas/FleetType.php @@ -6,7 +6,6 @@ class FleetType extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class FleetType extends SchemaProvider /** * @param \App\FleetType $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,42 +24,43 @@ public function getId($resource) /** * @param \App\FleetType $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\FleetType $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'fleets' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Handbook.php b/app/JsonApi/Schemas/Handbook.php index 054e34b..e8d212b 100644 --- a/app/JsonApi/Schemas/Handbook.php +++ b/app/JsonApi/Schemas/Handbook.php @@ -6,7 +6,6 @@ class Handbook extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Handbook extends SchemaProvider /** * @param \App\Handbook $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,62 +24,63 @@ public function getId($resource) /** * @param \App\Handbook $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'title' => $resource->title, + 'title' => $resource->title, 'description' => $resource->description, - 'content' => $resource->content, - 'order' => $resource->order, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'content' => $resource->content, + 'order' => $resource->order, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Handbook $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'createdBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['createdBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { return $resource->createdBy; - } + }, ], 'lastUpdatedBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { return $resource->lastUpdatedBy; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Invoice.php b/app/JsonApi/Schemas/Invoice.php index b505d64..6b5c495 100644 --- a/app/JsonApi/Schemas/Invoice.php +++ b/app/JsonApi/Schemas/Invoice.php @@ -6,7 +6,6 @@ class Invoice extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Invoice extends SchemaProvider /** * @param \App\Invoice $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,80 +24,81 @@ public function getId($resource) /** * @param \App\Invoice $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'code' => $resource->code, - 'title' => $resource->title, - 'status' => $resource->status, - 'total' => $resource->total, - 'due-date' => $resource->due_date->toIso8601String(), + 'code' => $resource->code, + 'title' => $resource->title, + 'status' => $resource->status, + 'total' => $resource->total, + 'due-date' => $resource->due_date->toIso8601String(), 'hard-due-date' => $resource->hard_due_date->toIso8601String(), - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Invoice $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'payments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'issuer' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['issuer']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['issuer']), + self::DATA => function () use ($resource) { return $resource->issuer; - } + }, ], 'recipient' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['recipient']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['recipient']), + self::DATA => function () use ($resource) { return $resource->recipient; - } + }, ], 'items' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true - ] + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/InvoiceItem.php b/app/JsonApi/Schemas/InvoiceItem.php index 1d36fc2..d761e2e 100644 --- a/app/JsonApi/Schemas/InvoiceItem.php +++ b/app/JsonApi/Schemas/InvoiceItem.php @@ -6,7 +6,6 @@ class InvoiceItem extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class InvoiceItem extends SchemaProvider /** * @param \App\InvoiceItem $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,44 +24,45 @@ public function getId($resource) /** * @param \App\InvoiceItem $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'quantity' => $resource->quantity, - 'cost' => $resource->cost, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'quantity' => $resource->quantity, + 'cost' => $resource->cost, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\InvoiceItem $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'invoice' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['invoice']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['invoice']), + self::DATA => function () use ($resource) { return $resource->invoice; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Membership.php b/app/JsonApi/Schemas/Membership.php index dcaaf1d..7451af9 100644 --- a/app/JsonApi/Schemas/Membership.php +++ b/app/JsonApi/Schemas/Membership.php @@ -6,7 +6,6 @@ class Membership extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Membership extends SchemaProvider /** * @param \App\Membership $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,13 +24,14 @@ public function getId($resource) /** * @param \App\Membership $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'notes' => $resource->notes, + 'notes' => $resource->notes, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -38,73 +39,73 @@ public function getAttributes($resource) /** * @param \App\Membership $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'membershipLevel' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['membershipLevel']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['membershipLevel']), + self::DATA => function () use ($resource) { return $resource->membershipLevel; - } + }, ], 'organization' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['organization']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { return $resource->organization; - } + }, ], 'member' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['member']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['member']), + self::DATA => function () use ($resource) { return $resource->member; - } + }, ], 'createdBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['createdBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { return $resource->createdBy; - } + }, ], 'lastUpdatedBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { return $resource->lastUpdatedBy; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/MembershipFee.php b/app/JsonApi/Schemas/MembershipFee.php index 1d9a81b..767ff88 100644 --- a/app/JsonApi/Schemas/MembershipFee.php +++ b/app/JsonApi/Schemas/MembershipFee.php @@ -6,7 +6,6 @@ class MembershipFee extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class MembershipFee extends SchemaProvider /** * @param \App\MembershipFee $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,42 +24,43 @@ public function getId($resource) /** * @param \App\MembershipFee $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ 'amount-type' => $resource->amount_type, - 'amount' => $resource->amount, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'amount' => $resource->amount, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\MembershipFee $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'billingConditions' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true - ] + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/MembershipLevel.php b/app/JsonApi/Schemas/MembershipLevel.php index 38a4a32..2507a31 100644 --- a/app/JsonApi/Schemas/MembershipLevel.php +++ b/app/JsonApi/Schemas/MembershipLevel.php @@ -6,7 +6,6 @@ class MembershipLevel extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class MembershipLevel extends SchemaProvider /** * @param \App\MembershipLevel $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,67 +24,68 @@ public function getId($resource) /** * @param \App\MembershipLevel $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, - 'description' => $resource->description, - 'dues' => $resource->dues, + 'name' => $resource->name, + 'description' => $resource->description, + 'dues' => $resource->dues, 'dues-structure' => $resource->dues_structure, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\MembershipLevel $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'memberships' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'owner' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['owner']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['owner']), + self::DATA => function () use ($resource) { return $resource->owner; - } + }, ], 'createdBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['createdBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['createdBy']), + self::DATA => function () use ($resource) { return $resource->createdBy; - } + }, ], 'lastUpdatedBy' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['lastUpdatedBy']), + self::DATA => function () use ($resource) { return $resource->lastUpdatedBy; - } + }, ], 'permissions' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true - ] + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/OAuth2Token.php b/app/JsonApi/Schemas/OAuth2Token.php index b87cce9..cbd78f7 100644 --- a/app/JsonApi/Schemas/OAuth2Token.php +++ b/app/JsonApi/Schemas/OAuth2Token.php @@ -6,7 +6,6 @@ class OAuth2Token extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class OAuth2Token extends SchemaProvider /** * @param \App\OAuth2Token $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,38 +24,39 @@ public function getId($resource) /** * @param \App\OAuth2Token $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'access-token' => $resource->access_token, + 'access-token' => $resource->access_token, 'refresh-token' => $resource->refresh_token, - 'expires-on' => $resource->expires_on->toIso8601String(), - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'expires-on' => $resource->expires_on->toIso8601String(), + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\OAuth2Token $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'character' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['character']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['character']), + self::DATA => function () use ($resource) { return $resource->character; - } - ] + }, + ], ]; } } - diff --git a/app/JsonApi/Schemas/Permission.php b/app/JsonApi/Schemas/Permission.php index 58dd9de..ed2bc7c 100644 --- a/app/JsonApi/Schemas/Permission.php +++ b/app/JsonApi/Schemas/Permission.php @@ -6,7 +6,6 @@ class Permission extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class Permission extends SchemaProvider /** * @param \App\Permission $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,34 +24,35 @@ public function getId($resource) /** * @param \App\Permission $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'name' => $resource->name, + 'name' => $resource->name, 'description' => $resource->description, - 'slug' => $resource->slug, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'slug' => $resource->slug, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\Permission $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'membershipLevels' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true - ] + self::SHOW_SELF => true, + self::SHOW_RELATED => true, + ], ]; } } - diff --git a/app/JsonApi/Schemas/ReplacementClaim.php b/app/JsonApi/Schemas/ReplacementClaim.php index edbe9ea..000eafc 100644 --- a/app/JsonApi/Schemas/ReplacementClaim.php +++ b/app/JsonApi/Schemas/ReplacementClaim.php @@ -6,7 +6,6 @@ class ReplacementClaim extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class ReplacementClaim extends SchemaProvider /** * @param \App\ReplacementClaim $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,62 +24,63 @@ public function getId($resource) /** * @param \App\ReplacementClaim $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'killmail-id' => $resource->killmail_id, + 'killmail-id' => $resource->killmail_id, 'killmail-hash' => $resource->killmail_hash, - 'total' => $resource->total, - 'status' => $resource->status, - 'created-at' => $resource->created_at->toIso8601String(), - 'updated-at' => $resource->updated_at->toIso8601String(), + 'total' => $resource->total, + 'status' => $resource->status, + 'created-at' => $resource->created_at->toIso8601String(), + 'updated-at' => $resource->updated_at->toIso8601String(), ]; } /** * @param \App\ReplacementClaim $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'comments' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'character' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['character']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['character']), + self::DATA => function () use ($resource) { return $resource->character; - } + }, ], 'organization' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['organization']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['organization']), + self::DATA => function () use ($resource) { return $resource->organization; - } + }, ], 'fitting' => [ - self::SHOW_SELF => true, + self::SHOW_SELF => true, self::SHOW_RELATED => true, - self::SHOW_DATA => isset($includeRelationships['fitting']), - self::DATA => function () use ($resource) { + self::SHOW_DATA => isset($includeRelationships['fitting']), + self::DATA => function () use ($resource) { return $resource->fitting; - } + }, ], ]; } } - diff --git a/app/JsonApi/Schemas/User.php b/app/JsonApi/Schemas/User.php index b3776bd..2650267 100644 --- a/app/JsonApi/Schemas/User.php +++ b/app/JsonApi/Schemas/User.php @@ -6,7 +6,6 @@ class User extends SchemaProvider { - /** * @var string */ @@ -14,7 +13,8 @@ class User extends SchemaProvider /** * @param \App\User $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return string */ public function getId($resource) @@ -24,14 +24,15 @@ public function getId($resource) /** * @param \App\User $resource - * the domain record being serialized. + * the domain record being serialized. + * * @return array */ public function getAttributes($resource) { return [ - 'email' => $resource->email, - 'settings' => $resource->settings, + 'email' => $resource->email, + 'settings' => $resource->settings, 'created-at' => $resource->created_at->toIso8601String(), 'updated-at' => $resource->updated_at->toIso8601String(), ]; @@ -39,33 +40,33 @@ public function getAttributes($resource) /** * @param \App\User $resource - * @param bool $isPrimary - * @param array $includeRelationships + * @param bool $isPrimary + * @param array $includeRelationships + * * @return array */ public function getRelationships($resource, $isPrimary, array $includeRelationships) { return [ 'notifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'readNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'unreadNotifications' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], 'characters' => [ - self::SHOW_SELF => true, - self::SHOW_RELATED => true + self::SHOW_SELF => true, + self::SHOW_RELATED => true, ], ]; } } - diff --git a/app/JsonApi/Validators/Alliance.php b/app/JsonApi/Validators/Alliance.php index 449e64f..2f76f40 100644 --- a/app/JsonApi/Validators/Alliance.php +++ b/app/JsonApi/Validators/Alliance.php @@ -7,7 +7,6 @@ class Alliance extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Alliance extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/BillingCondition.php b/app/JsonApi/Validators/BillingCondition.php index 762f341..d516412 100644 --- a/app/JsonApi/Validators/BillingCondition.php +++ b/app/JsonApi/Validators/BillingCondition.php @@ -7,7 +7,6 @@ class BillingCondition extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class BillingCondition extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Character.php b/app/JsonApi/Validators/Character.php index 574e03e..63eca85 100644 --- a/app/JsonApi/Validators/Character.php +++ b/app/JsonApi/Validators/Character.php @@ -7,7 +7,6 @@ class Character extends AbstractValidatorProvider { - /** * @var string */ @@ -17,7 +16,8 @@ class Character extends AbstractValidatorProvider * Get the validation rules for the resource attributes. * * @param object|null $record - * the record being updated, or null if it is a create request. + * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -31,8 +31,9 @@ protected function attributeRules($record = null) * Define the validation rules for the resource relationships. * * @param RelationshipsValidatorInterface $relationships - * @param object|null $record - * the record being updated, or null if it is a create request. + * @param object|null $record + * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) @@ -50,5 +51,4 @@ protected function relationshipRules(RelationshipsValidatorInterface $relationsh $relationships->hasMany('readNotifications', 'notifications'); $relationships->hasMany('unreadNotifications', 'notifications'); } - } diff --git a/app/JsonApi/Validators/Coalition.php b/app/JsonApi/Validators/Coalition.php index cd2fc45..9aaba65 100644 --- a/app/JsonApi/Validators/Coalition.php +++ b/app/JsonApi/Validators/Coalition.php @@ -7,7 +7,6 @@ class Coalition extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Coalition extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Comment.php b/app/JsonApi/Validators/Comment.php index f1de912..a7169e4 100644 --- a/app/JsonApi/Validators/Comment.php +++ b/app/JsonApi/Validators/Comment.php @@ -7,7 +7,6 @@ class Comment extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Comment extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Corporation.php b/app/JsonApi/Validators/Corporation.php index 67b975a..604bddd 100644 --- a/app/JsonApi/Validators/Corporation.php +++ b/app/JsonApi/Validators/Corporation.php @@ -7,7 +7,6 @@ class Corporation extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Corporation extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Discount.php b/app/JsonApi/Validators/Discount.php index 35228fb..33ccd60 100644 --- a/app/JsonApi/Validators/Discount.php +++ b/app/JsonApi/Validators/Discount.php @@ -7,7 +7,6 @@ class Discount extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Discount extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Doctrine.php b/app/JsonApi/Validators/Doctrine.php index 890f005..8718f65 100644 --- a/app/JsonApi/Validators/Doctrine.php +++ b/app/JsonApi/Validators/Doctrine.php @@ -7,7 +7,6 @@ class Doctrine extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Doctrine extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Fitting.php b/app/JsonApi/Validators/Fitting.php index 14ca009..3e12708 100644 --- a/app/JsonApi/Validators/Fitting.php +++ b/app/JsonApi/Validators/Fitting.php @@ -7,7 +7,6 @@ class Fitting extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Fitting extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Fleet.php b/app/JsonApi/Validators/Fleet.php index 7e57cf5..0da0ce0 100644 --- a/app/JsonApi/Validators/Fleet.php +++ b/app/JsonApi/Validators/Fleet.php @@ -7,7 +7,6 @@ class Fleet extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Fleet extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/FleetType.php b/app/JsonApi/Validators/FleetType.php index adc8d3e..47ea961 100644 --- a/app/JsonApi/Validators/FleetType.php +++ b/app/JsonApi/Validators/FleetType.php @@ -7,7 +7,6 @@ class FleetType extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class FleetType extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Handbook.php b/app/JsonApi/Validators/Handbook.php index fcd4e00..f5946db 100644 --- a/app/JsonApi/Validators/Handbook.php +++ b/app/JsonApi/Validators/Handbook.php @@ -7,7 +7,6 @@ class Handbook extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Handbook extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Invoice.php b/app/JsonApi/Validators/Invoice.php index 8e346b2..4791d46 100644 --- a/app/JsonApi/Validators/Invoice.php +++ b/app/JsonApi/Validators/Invoice.php @@ -7,7 +7,6 @@ class Invoice extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Invoice extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/InvoiceItem.php b/app/JsonApi/Validators/InvoiceItem.php index 3905fac..9d5b632 100644 --- a/app/JsonApi/Validators/InvoiceItem.php +++ b/app/JsonApi/Validators/InvoiceItem.php @@ -7,7 +7,6 @@ class InvoiceItem extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class InvoiceItem extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Membership.php b/app/JsonApi/Validators/Membership.php index 55e41ca..9c29f93 100644 --- a/app/JsonApi/Validators/Membership.php +++ b/app/JsonApi/Validators/Membership.php @@ -7,7 +7,6 @@ class Membership extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Membership extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/MembershipFee.php b/app/JsonApi/Validators/MembershipFee.php index 1b0488b..131d823 100644 --- a/app/JsonApi/Validators/MembershipFee.php +++ b/app/JsonApi/Validators/MembershipFee.php @@ -7,7 +7,6 @@ class MembershipFee extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class MembershipFee extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/MembershipLevel.php b/app/JsonApi/Validators/MembershipLevel.php index f1976a4..742ea44 100644 --- a/app/JsonApi/Validators/MembershipLevel.php +++ b/app/JsonApi/Validators/MembershipLevel.php @@ -7,7 +7,6 @@ class MembershipLevel extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class MembershipLevel extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/OAuth2Token.php b/app/JsonApi/Validators/OAuth2Token.php index 633da7e..0c9f423 100644 --- a/app/JsonApi/Validators/OAuth2Token.php +++ b/app/JsonApi/Validators/OAuth2Token.php @@ -7,7 +7,6 @@ class OAuth2Token extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class OAuth2Token extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/Permission.php b/app/JsonApi/Validators/Permission.php index 6b0ad71..e5e0512 100644 --- a/app/JsonApi/Validators/Permission.php +++ b/app/JsonApi/Validators/Permission.php @@ -7,7 +7,6 @@ class Permission extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class Permission extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/ReplacementClaim.php b/app/JsonApi/Validators/ReplacementClaim.php index e534591..49678fe 100644 --- a/app/JsonApi/Validators/ReplacementClaim.php +++ b/app/JsonApi/Validators/ReplacementClaim.php @@ -7,7 +7,6 @@ class ReplacementClaim extends AbstractValidatorProvider { - /** * @var string */ @@ -18,6 +17,7 @@ class ReplacementClaim extends AbstractValidatorProvider * * @param $record * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -33,11 +33,11 @@ protected function attributeRules($record = null) * @param RelationshipsValidatorInterface $relationships * @param $record * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/JsonApi/Validators/User.php b/app/JsonApi/Validators/User.php index 3af1831..f04076f 100644 --- a/app/JsonApi/Validators/User.php +++ b/app/JsonApi/Validators/User.php @@ -7,7 +7,6 @@ class User extends AbstractValidatorProvider { - /** * @var string */ @@ -17,7 +16,8 @@ class User extends AbstractValidatorProvider * Get the validation rules for the resource attributes. * * @param object|null $record - * the record being updated, or null if it is a create request. + * the record being updated, or null if it is a create request. + * * @return array */ protected function attributeRules($record = null) @@ -31,13 +31,13 @@ protected function attributeRules($record = null) * Define the validation rules for the resource relationships. * * @param RelationshipsValidatorInterface $relationships - * @param object|null $record - * the record being updated, or null if it is a create request. + * @param object|null $record + * the record being updated, or null if it is a create request. + * * @return void */ protected function relationshipRules(RelationshipsValidatorInterface $relationships, $record = null) { // } - } diff --git a/app/Listeners/BubbleNotification.php b/app/Listeners/BubbleNotification.php index 814a891..e60db08 100644 --- a/app/Listeners/BubbleNotification.php +++ b/app/Listeners/BubbleNotification.php @@ -3,8 +3,6 @@ namespace App\Listeners; use Illuminate\Notifications\Events\NotificationSent; -use Illuminate\Queue\InteractsWithQueue; -use Illuminate\Contracts\Queue\ShouldQueue; class BubbleNotification { @@ -21,14 +19,14 @@ public function __construct() /** * Handle the event. * - * @param NotificationSent $event + * @param NotificationSent $event + * * @return void */ public function handle(NotificationSent $event) { // if the notification is meant to be bubbled, do it - if (method_exists($event->notifiable, 'bubbleNotification')) - { + if (method_exists($event->notifiable, 'bubbleNotification')) { $event->notifiable->bubbleNotification($event); } } diff --git a/app/Membership.php b/app/Membership.php index fb367d7..cbd1b7a 100644 --- a/app/Membership.php +++ b/app/Membership.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class Membership + * Class Membership. * * @property string id * @property string owner_id @@ -36,7 +36,7 @@ class Membership extends Model use Notifiable; /** - * Get the membership level that this membership belongs to + * Get the membership level that this membership belongs to. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -46,7 +46,7 @@ public function membershipLevel() } /** - * Get the organization model for this membership + * Get the organization model for this membership. * * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ @@ -56,7 +56,7 @@ public function organization() } /** - * Get the member model for this membership + * Get the member model for this membership. * * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ @@ -66,7 +66,7 @@ public function member() } /** - * Get the character that created this membership + * Get the character that created this membership. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -76,7 +76,7 @@ public function createdBy() } /** - * Get the character that last edited this membership + * Get the character that last edited this membership. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ diff --git a/app/MembershipFee.php b/app/MembershipFee.php index 2a81785..f8b30db 100644 --- a/app/MembershipFee.php +++ b/app/MembershipFee.php @@ -8,13 +8,13 @@ use Illuminate\Support\Carbon; /** - * Class MembershipFee + * Class MembershipFee. * * @property string id * @property string owner_id * @property string owner_type * @property string amount_type - * @property double amount + * @property float amount * @property Carbon created_at * @property Carbon updated_at * diff --git a/app/MembershipLevel.php b/app/MembershipLevel.php index 23f2f51..5c2eac7 100644 --- a/app/MembershipLevel.php +++ b/app/MembershipLevel.php @@ -7,14 +7,14 @@ use Illuminate\Support\Carbon; /** - * Class MembershipLevel + * Class MembershipLevel. * * @property string id * @property string owner_id * @property string owner_type * @property string name * @property string description - * @property double dues + * @property float dues * @property string dues_structure * @property string created_by * @property string updated_by diff --git a/app/Notifications/Invoice/CommentPosted.php b/app/Notifications/Invoice/CommentPosted.php index 6bfd3e0..70d7fae 100644 --- a/app/Notifications/Invoice/CommentPosted.php +++ b/app/Notifications/Invoice/CommentPosted.php @@ -3,9 +3,9 @@ namespace App\Notifications\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class CommentPosted extends Notification implements ShouldQueue { @@ -24,7 +24,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +36,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +51,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/Created.php b/app/Notifications/Invoice/Created.php index dcd2fd2..30a431c 100644 --- a/app/Notifications/Invoice/Created.php +++ b/app/Notifications/Invoice/Created.php @@ -4,10 +4,10 @@ use App\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\BroadcastMessage; +use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Created extends Notification implements ShouldQueue { @@ -30,7 +30,8 @@ public function __construct(Invoice $invoice) /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -41,12 +42,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -56,17 +58,18 @@ public function toBroadcast($notifiable) { return new BroadcastMessage([ 'invoice_id' => $this->invoice->id, - 'from' => $this->invoice->owner()->first()->name, - 'to' => $this->invoice->recipient()->first()->name, - 'amount' => $this->invoice->total, - 'due' => $this->invoice->due_date + 'from' => $this->invoice->owner()->first()->name, + 'to' => $this->invoice->recipient()->first()->name, + 'amount' => $this->invoice->total, + 'due' => $this->invoice->due_date, ]); } /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/ForcePaymentPosted.php b/app/Notifications/Invoice/ForcePaymentPosted.php index 5410dbf..0596758 100644 --- a/app/Notifications/Invoice/ForcePaymentPosted.php +++ b/app/Notifications/Invoice/ForcePaymentPosted.php @@ -3,9 +3,8 @@ namespace App\Notifications\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class ForcePaymentPosted extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/Fulfilled.php b/app/Notifications/Invoice/Fulfilled.php index a65081a..990133f 100644 --- a/app/Notifications/Invoice/Fulfilled.php +++ b/app/Notifications/Invoice/Fulfilled.php @@ -3,9 +3,8 @@ namespace App\Notifications\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Fulfilled extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/PaymentPosted.php b/app/Notifications/Invoice/PaymentPosted.php index fe291a8..3550c37 100644 --- a/app/Notifications/Invoice/PaymentPosted.php +++ b/app/Notifications/Invoice/PaymentPosted.php @@ -3,9 +3,8 @@ namespace App\Notifications\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class PaymentPosted extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/StateChanged.php b/app/Notifications/Invoice/StateChanged.php index 8cbf778..dea5c51 100644 --- a/app/Notifications/Invoice/StateChanged.php +++ b/app/Notifications/Invoice/StateChanged.php @@ -3,9 +3,8 @@ namespace App\Notifications\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class StateChanged extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Invoice/Updated.php b/app/Notifications/Invoice/Updated.php index ea8c0b4..6cdc9c1 100644 --- a/app/Notifications/Invoice/Updated.php +++ b/app/Notifications/Invoice/Updated.php @@ -4,9 +4,9 @@ use App\Invoice; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Updated extends Notification implements ShouldQueue { @@ -29,7 +29,8 @@ public function __construct(Invoice $invoice) /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -46,12 +47,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('There is a new invoice available for '.$this->invoice->recipient()->name.'.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -60,7 +62,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Membership/Created.php b/app/Notifications/Membership/Created.php index eae8bee..da22acc 100644 --- a/app/Notifications/Membership/Created.php +++ b/app/Notifications/Membership/Created.php @@ -3,9 +3,8 @@ namespace App\Notifications\Membership; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Created extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Membership/Deleted.php b/app/Notifications/Membership/Deleted.php index e934c8d..d176293 100644 --- a/app/Notifications/Membership/Deleted.php +++ b/app/Notifications/Membership/Deleted.php @@ -3,9 +3,8 @@ namespace App\Notifications\Membership; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Deleted extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/Membership/Updated.php b/app/Notifications/Membership/Updated.php index ecf8e9a..876420f 100644 --- a/app/Notifications/Membership/Updated.php +++ b/app/Notifications/Membership/Updated.php @@ -3,9 +3,8 @@ namespace App\Notifications\Membership; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Updated extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/ReplacementClaim/Approved.php b/app/Notifications/ReplacementClaim/Approved.php index 5fb8cc0..1de6f8a 100644 --- a/app/Notifications/ReplacementClaim/Approved.php +++ b/app/Notifications/ReplacementClaim/Approved.php @@ -3,9 +3,8 @@ namespace App\Notifications\ReplacementClaim; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Approved extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/ReplacementClaim/Created.php b/app/Notifications/ReplacementClaim/Created.php index 0aca682..67771f6 100644 --- a/app/Notifications/ReplacementClaim/Created.php +++ b/app/Notifications/ReplacementClaim/Created.php @@ -3,9 +3,8 @@ namespace App\Notifications\ReplacementClaim; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Created extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/Notifications/ReplacementClaim/Dispersed.php b/app/Notifications/ReplacementClaim/Dispersed.php index 9294e3f..246caef 100644 --- a/app/Notifications/ReplacementClaim/Dispersed.php +++ b/app/Notifications/ReplacementClaim/Dispersed.php @@ -3,9 +3,8 @@ namespace App\Notifications\ReplacementClaim; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; class Dispersed extends Notification { @@ -24,7 +23,8 @@ public function __construct() /** * Get the notification's delivery channels. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function via($notifiable) @@ -35,12 +35,13 @@ public function via($notifiable) /** * Get the mail representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { - return (new MailMessage) + return (new MailMessage()) ->line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); @@ -49,7 +50,8 @@ public function toMail($notifiable) /** * Get the array representation of the notification. * - * @param mixed $notifiable + * @param mixed $notifiable + * * @return array */ public function toArray($notifiable) diff --git a/app/OAuth2Token.php b/app/OAuth2Token.php index d764a64..c501b79 100644 --- a/app/OAuth2Token.php +++ b/app/OAuth2Token.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class OAuth2Token + * Class OAuth2Token. * * @property string id * @property string character_id @@ -25,7 +25,7 @@ class OAuth2Token extends Model use UuidTrait; /** - * Get the character that owns this OAuth2Token + * Get the character that owns this OAuth2Token. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ diff --git a/app/Permission.php b/app/Permission.php index b414f93..0d7515e 100644 --- a/app/Permission.php +++ b/app/Permission.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; /** - * Class Permission + * Class Permission. * * @property string id * @property string name diff --git a/app/Policies/CoalitionPolicy.php b/app/Policies/CoalitionPolicy.php index 6010ff9..65f6474 100644 --- a/app/Policies/CoalitionPolicy.php +++ b/app/Policies/CoalitionPolicy.php @@ -2,8 +2,8 @@ namespace App\Policies; -use App\User; use App\Coalition; +use App\User; use Illuminate\Auth\Access\HandlesAuthorization; class CoalitionPolicy @@ -13,8 +13,9 @@ class CoalitionPolicy /** * Determine whether the user can view the coalition. * - * @param \App\User $user - * @param \App\Coalition $coalition + * @param \App\User $user + * @param \App\Coalition $coalition + * * @return mixed */ public function view(User $user, Coalition $coalition) @@ -29,7 +30,8 @@ public function view(User $user, Coalition $coalition) /** * Determine whether the user can create coalitions. * - * @param \App\User $user + * @param \App\User $user + * * @return mixed */ public function create(User $user) @@ -41,8 +43,9 @@ public function create(User $user) /** * Determine whether the user can update the coalition. * - * @param \App\User $user - * @param \App\Coalition $coalition + * @param \App\User $user + * @param \App\Coalition $coalition + * * @return mixed */ public function update(User $user, Coalition $coalition) @@ -57,8 +60,9 @@ public function update(User $user, Coalition $coalition) /** * Determine whether the user can delete the coalition. * - * @param \App\User $user - * @param \App\Coalition $coalition + * @param \App\User $user + * @param \App\Coalition $coalition + * * @return mixed */ public function delete(User $user, Coalition $coalition) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 9784b1a..9e68caa 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,7 +2,6 @@ namespace App\Providers; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 352cce4..395c518 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Broadcast; +use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 10f6672..6971d4b 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,9 +2,8 @@ namespace App\Providers; -use Illuminate\Notifications\Events\NotificationSent; -use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { @@ -15,8 +14,8 @@ class EventServiceProvider extends ServiceProvider */ protected $listen = [ 'Illuminate\Notifications\Events\NotificationSent' => [ - 'App\Listeners\BubbleNotification' - ] + 'App\Listeners\BubbleNotification', + ], ]; protected $subscribe = []; diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index b36415e..37aac4a 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { diff --git a/app/ReplacementClaim.php b/app/ReplacementClaim.php index c331cd6..d1367f3 100644 --- a/app/ReplacementClaim.php +++ b/app/ReplacementClaim.php @@ -9,7 +9,7 @@ use Illuminate\Support\Carbon; /** - * Class ReplacementClaim + * Class ReplacementClaim. * * @property string id * @property string character_id @@ -18,7 +18,7 @@ * @property string fitting_id * @property int killmail_id * @property string killmail_hash - * @property double total + * @property float total * @property string status * @property Carbon created_at * @property Carbon updated_at diff --git a/app/Traits/BubblesNotifications.php b/app/Traits/BubblesNotifications.php index 36aa2a0..7d6362d 100644 --- a/app/Traits/BubblesNotifications.php +++ b/app/Traits/BubblesNotifications.php @@ -13,7 +13,7 @@ trait BubblesNotifications public $bubbleToRelation = null; /** - * Get the models to bubble notifications to + * Get the models to bubble notifications to. * * @return \Illuminate\Database\Eloquent\Collection */ @@ -30,7 +30,7 @@ protected function getBubbleToModels(Notification $notification) } /** - * Bubble the given notification to the defined models + * Bubble the given notification to the defined models. * * @param NotificationSent $notificationSent */ @@ -46,4 +46,4 @@ public function bubbleNotification(NotificationSent $notificationSent) } } } -} \ No newline at end of file +} diff --git a/app/Traits/HasComments.php b/app/Traits/HasComments.php index 1221b67..783d468 100644 --- a/app/Traits/HasComments.php +++ b/app/Traits/HasComments.php @@ -5,7 +5,7 @@ use App\Comment; /** - * Trait HasComments + * Trait HasComments. * * @method morphMany(string $related, string $name) */ @@ -20,4 +20,4 @@ public function comments() { return $this->morphMany(Comment::class, 'commentable'); } -} \ No newline at end of file +} diff --git a/app/Traits/HasHandbooks.php b/app/Traits/HasHandbooks.php index 41e0f90..33c217f 100644 --- a/app/Traits/HasHandbooks.php +++ b/app/Traits/HasHandbooks.php @@ -1,10 +1,11 @@ morphMany(Handbook::class, 'owner'); } -} \ No newline at end of file +} diff --git a/app/Traits/HasMembers.php b/app/Traits/HasMembers.php index 18bd4a4..0071500 100644 --- a/app/Traits/HasMembers.php +++ b/app/Traits/HasMembers.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; /** - * Trait HasMembers + * Trait HasMembers. * * @method morphMany(string $related, string $name) * @method belongsTo(string $related, string $foreignKey) @@ -16,7 +16,7 @@ trait HasMembers { /** - * Get any memberships that belong to the model + * Get any memberships that belong to the model. * * @return MorphMany */ @@ -26,7 +26,7 @@ public function members() } /** - * Get the membership level that is set as the default for joining this model + * Get the membership level that is set as the default for joining this model. * * @return BelongsTo */ @@ -36,7 +36,7 @@ public function defaultMembershipLevel() } /** - * Get any membership levels that belong to this model + * Get any membership levels that belong to this model. * * @return MorphMany */ @@ -44,4 +44,4 @@ public function membershipLevels() { return $this->morphMany(MembershipLevel::class, 'owner'); } -} \ No newline at end of file +} diff --git a/app/Traits/HasSRP.php b/app/Traits/HasSRP.php index a09c422..ab14efd 100644 --- a/app/Traits/HasSRP.php +++ b/app/Traits/HasSRP.php @@ -5,7 +5,7 @@ use App\ReplacementClaim; /** - * Trait HasSRP + * Trait HasSRP. * * @method morphMany(string $related, string $name) */ @@ -15,4 +15,4 @@ public function claims() { return $this->morphMany(ReplacementClaim::class, 'organization'); } -} \ No newline at end of file +} diff --git a/app/Traits/IsMember.php b/app/Traits/IsMember.php index dcacecb..790ca65 100644 --- a/app/Traits/IsMember.php +++ b/app/Traits/IsMember.php @@ -6,14 +6,14 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; /** - * Trait IsMember + * Trait IsMember. * * @method morphMany(string $related, string $name) */ trait IsMember { /** - * Get any memberships the model is a part of + * Get any memberships the model is a part of. * * @return MorphMany */ @@ -21,4 +21,4 @@ public function memberships() { return $this->morphMany(Membership::class, 'organization'); } -} \ No newline at end of file +} diff --git a/app/Traits/IssuesInvoices.php b/app/Traits/IssuesInvoices.php index 6eb680a..3de7032 100644 --- a/app/Traits/IssuesInvoices.php +++ b/app/Traits/IssuesInvoices.php @@ -1,18 +1,19 @@ issuedInvoices()->where('state', Invoice::STATE_IN_DEFAULT); } -} \ No newline at end of file +} diff --git a/app/Traits/ModifiesAmounts.php b/app/Traits/ModifiesAmounts.php index 1634bb0..a0ec900 100644 --- a/app/Traits/ModifiesAmounts.php +++ b/app/Traits/ModifiesAmounts.php @@ -1,18 +1,19 @@ getAmount() * count($members); } } -} \ No newline at end of file +} diff --git a/app/Traits/ReceivesInvoices.php b/app/Traits/ReceivesInvoices.php index 1d42e19..9bc90ca 100644 --- a/app/Traits/ReceivesInvoices.php +++ b/app/Traits/ReceivesInvoices.php @@ -1,18 +1,19 @@ invoices()->where('state', Invoice::STATE_IN_DEFAULT); } -} \ No newline at end of file +} diff --git a/app/Traits/UuidTrait.php b/app/Traits/UuidTrait.php index 2e06eeb..92b5cf5 100644 --- a/app/Traits/UuidTrait.php +++ b/app/Traits/UuidTrait.php @@ -7,7 +7,7 @@ trait UuidTrait { - protected static function boot () + protected static function boot() { parent::boot(); @@ -24,4 +24,4 @@ public function getIncrementing() { return false; } -} \ No newline at end of file +} diff --git a/app/User.php b/app/User.php index c6e00bf..3e951da 100644 --- a/app/User.php +++ b/app/User.php @@ -3,13 +3,13 @@ namespace App; use App\Traits\UuidTrait; -use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Notifications\Notifiable; use Illuminate\Support\Carbon; use Tymon\JWTAuth\Contracts\JWTSubject; /** - * Class User + * Class User. * * @property string id * @property string email @@ -43,7 +43,7 @@ class User extends Authenticatable implements JWTSubject * @var array */ protected $hidden = [ - 'password' + 'password', ]; /** @@ -67,7 +67,7 @@ public function getJWTCustomClaims() } /** - * Get any characters that belong to the user + * Get any characters that belong to the user. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/config/app.php b/config/app.php index c47c77d..69a93d7 100644 --- a/config/app.php +++ b/config/app.php @@ -193,39 +193,39 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, ], diff --git a/config/auth.php b/config/auth.php index 468b7ae..8c6ec78 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'api', + 'guard' => 'api', 'passwords' => 'users', ], @@ -37,12 +37,12 @@ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'jwt-auth', + 'driver' => 'jwt-auth', 'provider' => 'users', ], ], @@ -67,7 +67,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\User::class, ], // 'users' => [ @@ -94,8 +94,8 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, ], ], diff --git a/config/broadcasting.php b/config/broadcasting.php index d109e28..28e2083 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -31,18 +31,18 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), + 'cluster' => env('PUSHER_APP_CLUSTER'), 'encrypted' => true, ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index fa12e5e..236e295 100644 --- a/config/cache.php +++ b/config/cache.php @@ -39,20 +39,20 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], @@ -61,15 +61,15 @@ ], 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/database.php b/config/database.php index 62e2c17..70f57cc 100644 --- a/config/database.php +++ b/config/database.php @@ -34,61 +34,61 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), + 'driver' => 'mysql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'strict' => true, - 'engine' => null, + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => true, + 'engine' => null, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - 'sslmode' => 'prefer', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sde_pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), 'database' => env('SDE_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - 'sslmode' => 'prefer', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'charset' => 'utf8', + 'prefix' => '', ], ], @@ -122,9 +122,9 @@ 'client' => 'predis', 'default' => [ - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], diff --git a/config/filesystems.php b/config/filesystems.php index 9568e02..6b70115 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,19 +45,19 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), diff --git a/config/hashing.php b/config/hashing.php index 4f316ab..ae009eb 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -17,4 +17,4 @@ 'driver' => 'argon', -]; \ No newline at end of file +]; diff --git a/config/json-api-v1.php b/config/json-api-v1.php index c8ec891..cacdca3 100644 --- a/config/json-api-v1.php +++ b/config/json-api-v1.php @@ -21,7 +21,7 @@ | - e.g. \App\JsonApi\Hydrators\{User, Post, Comment} | */ - 'namespace' => null, + 'namespace' => null, 'by-resource' => false, /* @@ -38,28 +38,28 @@ | `'posts' => App\Post::class` */ 'resources' => [ - 'users' => \App\User::class, - 'characters' => \App\Character::class, - 'corporations' => \App\Corporation::class, - 'alliances' => \App\Alliance::class, - 'coalitions' => \App\Coalition::class, - 'comments' => \App\Comment::class, - 'doctrines' => \App\Doctrine::class, - 'fittings' => \App\Fitting::class, - 'fleets' => \App\Fleet::class, - 'fleet-types' => \App\FleetType::class, - 'handbooks' => \App\Handbook::class, + 'users' => \App\User::class, + 'characters' => \App\Character::class, + 'corporations' => \App\Corporation::class, + 'alliances' => \App\Alliance::class, + 'coalitions' => \App\Coalition::class, + 'comments' => \App\Comment::class, + 'doctrines' => \App\Doctrine::class, + 'fittings' => \App\Fitting::class, + 'fleets' => \App\Fleet::class, + 'fleet-types' => \App\FleetType::class, + 'handbooks' => \App\Handbook::class, 'replacement-claims' => \App\ReplacementClaim::class, - 'discounts' => \App\Discount::class, + 'discounts' => \App\Discount::class, 'billing-conditions' => \App\BillingCondition::class, - 'invoices' => \App\Invoice::class, - 'invoice-items' => \App\InvoiceItem::class, - 'memberships' => \App\Membership::class, - 'membership-fees' => \App\MembershipFee::class, - 'membership-levels' => \App\MembershipLevel::class, - 'permissions' => \App\Permission::class, - 'settings' => \App\Setting::class, - 'oauth2-tokens' => \App\OAuth2Token::class, + 'invoices' => \App\Invoice::class, + 'invoice-items' => \App\InvoiceItem::class, + 'memberships' => \App\Membership::class, + 'membership-fees' => \App\MembershipFee::class, + 'membership-levels' => \App\MembershipLevel::class, + 'permissions' => \App\Permission::class, + 'settings' => \App\Setting::class, + 'oauth2-tokens' => \App\OAuth2Token::class, ], /* @@ -95,9 +95,9 @@ | */ 'url' => [ - 'host' => null, + 'host' => null, 'namespace' => '/api/v1', - 'name' => 'api:v1:', + 'name' => 'api:v1:', ], /* diff --git a/config/logging.php b/config/logging.php index 0c11f47..71e78ef 100644 --- a/config/logging.php +++ b/config/logging.php @@ -31,40 +31,40 @@ 'channels' => [ 'stack' => [ - 'driver' => 'stack', + 'driver' => 'stack', 'channels' => ['daily'], ], 'single' => [ 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', ], 'daily' => [ 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - 'days' => 7, + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 7, ], 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => 'critical', + 'emoji' => ':boom:', + 'level' => 'critical', ], 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => 'debug', ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => 'debug', ], ], -]; \ No newline at end of file +]; diff --git a/config/mail.php b/config/mail.php index bb92224..0951a33 100644 --- a/config/mail.php +++ b/config/mail.php @@ -57,7 +57,7 @@ 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'name' => env('MAIL_FROM_NAME', 'Example'), ], /* diff --git a/config/queue.php b/config/queue.php index 8c06fcc..81c0546 100644 --- a/config/queue.php +++ b/config/queue.php @@ -35,32 +35,32 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', 'retry_after' => 90, ], 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', 'retry_after' => 90, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => env('SQS_KEY', 'your-public-key'), + 'key' => env('SQS_KEY', 'your-public-key'), 'secret' => env('SQS_SECRET', 'your-secret-key'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), 'region' => env('SQS_REGION', 'us-east-1'), ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => 'default', + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', 'retry_after' => 90, ], @@ -79,7 +79,7 @@ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 4460f0e..6bb0952 100644 --- a/config/services.php +++ b/config/services.php @@ -20,7 +20,7 @@ ], 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], @@ -30,8 +30,8 @@ ], 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index facf233..91221f7 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -15,9 +15,9 @@ $factory->define(App\User::class, function (Faker $faker) { return [ - 'name' => $faker->name, - 'email' => $faker->unique()->safeEmail, - 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret + 'name' => $faker->name, + 'email' => $faker->unique()->safeEmail, + 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret 'remember_token' => str_random(10), ]; }); diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 74457ce..c645029 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,8 +1,8 @@ insert([ // Memberships [ - 'name' => 'Add Memberships', + 'name' => 'Add Memberships', 'description' => 'Can add new memberships to the organization', - 'slug' => 'membership_add' + 'slug' => 'membership_add', ], [ - 'name' => 'Delete Memberships', + 'name' => 'Delete Memberships', 'description' => 'Can add delete memberships from the organization', - 'slug' => 'membership_delete' + 'slug' => 'membership_delete', ], [ - 'name' => 'Edit Memberships', + 'name' => 'Edit Memberships', 'description' => 'Can edit memberships for the organization', - 'slug' => 'membership_edit' + 'slug' => 'membership_edit', ], [ - 'name' => 'View Memberships', + 'name' => 'View Memberships', 'description' => 'Can view memberships for the organization', - 'slug' => 'membership_view' + 'slug' => 'membership_view', ], // Handbooks [ - 'name' => 'Add Handbooks', + 'name' => 'Add Handbooks', 'description' => 'Can add new handbooks to the organization', - 'slug' => 'handbook_add' + 'slug' => 'handbook_add', ], [ - 'name' => 'Delete Handbooks', + 'name' => 'Delete Handbooks', 'description' => 'Can delete handbooks from the organization', - 'slug' => 'handbook_edit' + 'slug' => 'handbook_edit', ], [ - 'name' => 'Edit Handbooks', + 'name' => 'Edit Handbooks', 'description' => 'Can edit handbooks for the organization', - 'slug' => 'handbook_edit' + 'slug' => 'handbook_edit', ], [ - 'name' => 'View Handbooks', + 'name' => 'View Handbooks', 'description' => 'Can edit handbooks for the organization', - 'slug' => 'handbook_edit' + 'slug' => 'handbook_edit', ], // Discounts diff --git a/public/index.php b/public/index.php index 4584cbc..2b5641b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,12 +1,10 @@ */ - define('LARAVEL_START', microtime(true)); /* diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df..6ef1a73 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -13,7 +13,7 @@ | */ - 'failed' => 'These credentials do not match our records.', + 'failed' => 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', ]; diff --git a/resources/lang/en/pagination.php b/resources/lang/en/pagination.php index d481411..fcab34b 100644 --- a/resources/lang/en/pagination.php +++ b/resources/lang/en/pagination.php @@ -14,6 +14,6 @@ */ 'previous' => '« Previous', - 'next' => 'Next »', + 'next' => 'Next »', ]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e5544d2..ffa19ba 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -14,9 +14,9 @@ */ 'password' => 'Passwords must be at least six characters and match the confirmation.', - 'reset' => 'Your password has been reset!', - 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that e-mail address.", + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", ]; diff --git a/routes/api.php b/routes/api.php index 231339e..e7eeeb7 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,10 +1,9 @@ resource('characters', [ 'has-one' => [ - 'user' => ['except' => 'replace'], - 'token' => ['except' => 'replace'] + 'user' => ['except' => 'replace'], + 'token' => ['except' => 'replace'], ], 'has-many' => [ 'comments', @@ -51,7 +50,7 @@ 'notifications', 'readNotifications', 'unreadNotifications', - ] + ], ]); $api->resource('corporations', [ diff --git a/server.php b/server.php index 5fb6379..20bc389 100644 --- a/server.php +++ b/server.php @@ -1,12 +1,10 @@ */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index ff133fb..60a3e8c 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -2,8 +2,8 @@ namespace Tests; -use Illuminate\Support\Facades\Hash; use Illuminate\Contracts\Console\Kernel; +use Illuminate\Support\Facades\Hash; trait CreatesApplication { diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index f31e495..8fbf370 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -3,7 +3,6 @@ namespace Tests\Feature; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class ExampleTest extends TestCase { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c..06ece2c 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -3,7 +3,6 @@ namespace Tests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class ExampleTest extends TestCase {