Skip to content

Commit

Permalink
test lg
Browse files Browse the repository at this point in the history
  • Loading branch information
FahryIbrahim authored Sep 1, 2024
1 parent ca3e5fa commit 10e9b4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,19 @@ class User extends Authenticatable
'email_verified_at' => 'datetime',
];

public function tasks()
public function tasks(): HasMany
{
// TASK: fix this by adding a parameter
return $this->hasMany(Task::class, 'users_id');
}

public function comments()
public function comments(): HasManyThrough
{
// TASK: add the code here for two-level relationship
return $this->hasManyThrough(Comment::class, Task::class, 'users_id', 'task_id');
}

public function projects()
public function projects(): BelongsToMany
{
return $this->belongsToMany(Project::class)->withPivot('start_date');
}
Expand Down

0 comments on commit 10e9b4c

Please sign in to comment.