Skip to content

Commit

Permalink
GH-23 - using Playground User for Ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Jul 31, 2024
1 parent 980a989 commit e58b297
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions src/Models/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -541,17 +541,12 @@ public function board(): HasOne
/**
* The completed by user of the ticket.
*
* @return HasOne<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
* @return HasOne<User>
*/
public function completedBy(): HasOne
{
/**
* @var class-string<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
*/
$uc = config('auth.providers.users.model', '\\App\\Models\\User');

return $this->hasOne(
$uc,
User::class,
'id',
'completed_by_id'
);
Expand All @@ -574,17 +569,12 @@ public function epic(): HasOne
/**
* The fixed by user of the ticket.
*
* @return HasOne<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
* @return HasOne<User>
*/
public function fixedBy(): HasOne
{
/**
* @var class-string<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
*/
$uc = config('auth.providers.users.model', '\\App\\Models\\User');

return $this->hasOne(
$uc,
User::class,
'id',
'fixed_by_id'
);
Expand Down Expand Up @@ -677,17 +667,12 @@ public function release(): HasOne
/**
* The reported by user of the ticket.
*
* @return HasOne<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
* @return HasOne<User>
*/
public function reportedBy(): HasOne
{
/**
* @var class-string<EloquentModel&\Illuminate\Contracts\Auth\Authenticatable>
*/
$uc = config('auth.providers.users.model', '\\App\\Models\\User');

return $this->hasOne(
$uc,
User::class,
'id',
'reported_by_id'
);
Expand Down

0 comments on commit e58b297

Please sign in to comment.