mardi 28 mars 2017

laravel 5 retrieve all attributes from 2 relational tables by eloquent

Hello i have 2 table (Users and Posts) with 1 to many realtionship.

I want to retrive all data in one single query by eloquent and result should be as follow

Users table: id | name

Posts Table: id | user_id | title| body

retrived data should be

name | title | body



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

Aucun commentaire:

Enregistrer un commentaire