Organizational Research By

Surprising Reserch Topic

query builder object doesnt see aliases in previously built object laravel using -'php,mysql,laravel,query-builder'


query builder object doesnt see aliases in previously built object laravel  using -'php,mysql,laravel,query-builder'

Here's my first query:

$base=\DB::table('user')->select('firstname as name');


and then I want to access aliased column in second query:

$base->select('name');


but I see error. I can access all columns from table user though. Is there a way to change it so I can use aliased name in the second query?
    
asked Sep 7, 2015 by rajesh
0 votes
15 views



Related Hot Questions



Government Jobs Opening


...