i am using laravel 5.5 and am trying to show into a view the current data :
$data = DB::table('demandes')
->join('articles', 'articles.id', '=', 'demandes.article_id')
->join('users', 'users.id', '=', 'demandes.client_id')
->select('demandes.*', 'articles.nom_article', 'users.prenom')
->get();
i am trying to find how to make a foreach statement even thought its not the same table i am working with ,
here is the demande table :