Category archive

Laravel

Explore every article in Laravel, with preserved WordPress-friendly URLs.

4 articles

Laravel

how to get sql query from facade DB::table in laravel 5

Normally we fetch the data as below $dataresult = DB::table(‘sometable’) ->select(‘sometable.column1’, ‘sometable.column2’, ‘sometable.column3’, ‘sometable.column4’, ‘sometable.column5’) ->get(); Now if we want to get the actaul query from $dataresult using $dataresult->toSql(); // it will not work The solution for thi

Oct 7, 2017

Read article