This commit is contained in:
Adrian Hopek
2022-04-14 14:29:36 +02:00
parent 27c43872ba
commit e3998238ef
13 changed files with 499 additions and 183 deletions

View File

@@ -11,8 +11,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property User $owner
* @property User $previousOwner
* @property User $user
*/
class Key extends Model
{
@@ -20,14 +19,9 @@ class Key extends Model
protected $guarded = [];
public function owner(): BelongsTo
public function user(): BelongsTo
{
return $this->belongsTo(User::class, "owner_id");
}
public function previousOwner(): BelongsTo
{
return $this->belongsTo(User::class, "previous_owner_id");
return $this->belongsTo(User::class);
}
protected static function newFactory(): KeyFactory