I am new to laravel and making a basic application to get a grip on relationships.I have implemented one to one relationship and want to get specific columns from both the b
1 You need to always select primary key of the parent and foreign key of the child of a relation, otherwise Eloquent won't be able to match related models.
2 Closure passed to the eager loading is a value of the array, not 2nd parameter of with function:
User::with(array('identity_cards' => function($query) {
$query->select('issuance_location', 'user_id');
}))->get(array('first_name', 'id'))->toArray();
3 I would rename that relation to identity_card, for it's hasOne - it will be easier to work with.