Search code examples
phplaravellaravel-4eloquent

How can I query raw via Eloquent?


I am trying to do a query in my Laravel app and I want to use a normal structure for my query. This class either does use Eloquent so I need to find something to do a query totally raw.

Might be something like Model::query($query);. Only that doesn't work.


Solution

  • use DB::statement('your raw query here'). Hope this helps.