Example #1
0
 public function tasksActive($user)
 {
     return $this->belongsToMany(Task::getClass(), 'task_user')->wherePivot('status', 1)->wherePivot('user_id', $user);
 }
Example #2
0
 public function tasks()
 {
     return $this->belongsToMany(Task::getClass())->withPivot('status', 'menu_id');
 }