Laravel eloquent - prevent overriding values when joining tables

You can use 'select' like you would in a normal SQL query:

$response = Account::with('role')
    ->select('account.*')
    ->leftJoin('group', 'group.id', '=', 'account.group_id')
    ->get();

http://laravel.com/docs/queries#selects


Complementing the answer given by @beech, you can use alias inside your select clause, that way you can fetch only the specific keys you need e.g.

Account::with('role')
    ->select('account.id AS account_id', 'role.id AS role_id', 'account.name AS account_name', 'role.name AS role_name')
    ->leftJoin('group', 'group.id', '=', 'account.group_id')
    ->get();