You can load the relation and then use the object loaded
$order->load(['user.profile']);
$order->user->profile->first_name;
$order->user->profile->last_name;
or you can use query builder instead.
Thanks, but I get this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.order_id' in 'where clause' (SQL: select * from users
where users
.order_id
in (1))
Problems solved with help from stackoverflow:
http://stackoverflow.com/questions/43051342/laravel-5-4-struggling-with-relationships
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community