There are n number of situation where we want to write complex query so It is very difficult to write complex query using Laravel.So to overcome such problem Laravel provide raw query option. The syntax of writing raw query is:-
Syntax:
DB::select(DB::raw('Write query here'));
Example:
DB::select(DB::raw('RENAME TABLE photos TO images'));
By this way we can write raw query in laravel 4.x
0 Comment(s)