mardi 1 octobre 2019

Laravel WithCount using where

i have two tables : Table 1 courses : - id_cours - field_cours

Table 2 Question : - id_quest - field_quest - id_cours - id_user

The question is i want to Count all question just added by the user logged .

i try with this one :

 public function answers()
    {
        return $this->hasMany('App\QuestionUsers','idcours', 'id_cours');

    }

but he count all question added by all users . Please need Help



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2muTR4a
via IFTTT

Aucun commentaire:

Enregistrer un commentaire