Skip to content

Commit 5aa8153

Browse files
committed
Created user relations
1 parent 306d927 commit 5aa8153

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

app/Models/User.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// use Illuminate\Contracts\Auth\MustVerifyEmail;
66
use Illuminate\Database\Eloquent\Factories\HasFactory;
7+
use Illuminate\Database\Eloquent\Relations\HasMany;
78
use Illuminate\Foundation\Auth\User as Authenticatable;
89
use Illuminate\Notifications\Notifiable;
910
use Laravel\Fortify\TwoFactorAuthenticatable;
@@ -49,4 +50,28 @@ protected function casts(): array
4950
'two_factor_confirmed_at' => 'datetime',
5051
];
5152
}
53+
54+
/**
55+
* Get the work sessions for the user.
56+
*/
57+
public function workSessions(): HasMany
58+
{
59+
return $this->hasMany(WorkSession::class);
60+
}
61+
62+
/**
63+
* Get the check-ins for the user.
64+
*/
65+
public function checkIns(): HasMany
66+
{
67+
return $this->hasMany(CheckIn::class);
68+
}
69+
70+
/**
71+
* Get the changelog entries for the user.
72+
*/
73+
public function changelogEntries(): HasMany
74+
{
75+
return $this->hasMany(ChangelogEntry::class);
76+
}
5277
}

0 commit comments

Comments
 (0)