i have 3 tables :
Table 1
courses
:- id_cours
- field_cours
Table 2
Question
:- id_quest
- field_quest
- id_cours
- id_user
- Table 3
Users
: -id -nom
The question is i want to Count all question just added by the user logged .
i try with this one in the Model Courses : but i want to add where id_user = id
public function answers()
{
return $this->hasMany('App\QuestionUsers','idcours', 'id_cours');
}
but this returns count of all question added by all users . Please need Help