mardi 25 juillet 2017

How can i get query result id in controller from Laravel?

I want to take houses lists and houses pictures on mysql from laravel. But, i have any problem. This:

$houses = Houses::query()
             ->orderBy('sort', 'ASC')
             ->take('6')
             ->get();

This query, give houses list to me. And i writing new code:

$pictures = Housephotos::query()
            ->where('house_id', '=', $houses->house_id)
            ->get();

Question one: This process is true?
Question two : How can i write my project?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire