1

I have a complex business logic to retrieve data from a MYSQL database.

I am using laravel eloquent query builder to retrieve data but if I call a MYSQL procedure using raw query in laravel, I would not be able to exploit features of laravel like model relationships or pagination, etc.

What is the correct way to handle this situation? Should I write my logic in proc (use joins (model relationships) ) and use it as raw query or is there any better approach?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
  • 1
    your questions is too broad, it depends on your application and it's all up to you to figured it out if eloquent is going to help you, or slow you down on your development – Fabio Antunes Jul 04 '15 at 15:43
  • In addition to Fabio, General I will use Eloquent, and special scenario like creating trigger will use raw query, there is no point using only raw query, if Eloquent can be used. Look at this for inspiration http://stackoverflow.com/questions/22925451/how-can-i-query-raw-via-eloquent – Maytham Fahmi Jul 06 '15 at 12:56

0 Answers0