mirror of
https://github.com/10h30/Test-Eloquent-Relationships.git
synced 2026-07-19 06:33:46 +09:00
Task 8 - belongstomany add
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user