Task 8 - belongstomany add

This commit is contained in:
PovilasKorop
2021-11-22 11:46:59 +02:00
parent fc0bf0d079
commit a114584904
8 changed files with 129 additions and 1 deletions
+5
View File
@@ -52,4 +52,9 @@ class User extends Authenticatable
{
// TASK: add the code here for two-level relationship
}
public function projects()
{
return $this->belongsToMany(Project::class)->withPivot('start_date');
}
}