From e58b29782d020e7db42e05e21b06188474c9a91e Mon Sep 17 00:00:00 2001 From: Jeremy Postlethwaite Date: Wed, 31 Jul 2024 16:28:26 -0700 Subject: [PATCH] GH-23 - using Playground User for Ticket --- src/Models/Ticket.php | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/Models/Ticket.php b/src/Models/Ticket.php index ab68fce..f638f57 100644 --- a/src/Models/Ticket.php +++ b/src/Models/Ticket.php @@ -6,9 +6,9 @@ declare(strict_types=1); namespace Playground\Matrix\Models; -use Illuminate\Database\Eloquent\Model as EloquentModel; use Illuminate\Database\Eloquent\Relations\HasOne; use Playground\Models\Model; +use Playground\Models\User; /** * \Playground\Matrix\Models\Ticket @@ -541,17 +541,12 @@ public function board(): HasOne /** * The completed by user of the ticket. * - * @return HasOne + * @return HasOne */ public function completedBy(): HasOne { - /** - * @var class-string - */ - $uc = config('auth.providers.users.model', '\\App\\Models\\User'); - return $this->hasOne( - $uc, + User::class, 'id', 'completed_by_id' ); @@ -574,17 +569,12 @@ public function epic(): HasOne /** * The fixed by user of the ticket. * - * @return HasOne + * @return HasOne */ public function fixedBy(): HasOne { - /** - * @var class-string - */ - $uc = config('auth.providers.users.model', '\\App\\Models\\User'); - return $this->hasOne( - $uc, + User::class, 'id', 'fixed_by_id' ); @@ -677,17 +667,12 @@ public function release(): HasOne /** * The reported by user of the ticket. * - * @return HasOne + * @return HasOne */ public function reportedBy(): HasOne { - /** - * @var class-string - */ - $uc = config('auth.providers.users.model', '\\App\\Models\\User'); - return $this->hasOne( - $uc, + User::class, 'id', 'reported_by_id' );