Skip to content

Tag: laravel-5

How to convert SQL query in laravel query?

I know this question is not asked in a well manner way,so I am sorry,I have SQL query this one I want to convert it in PHP laravel query form so tried this query but I don’t know SQL and even I am not understanding how I convert it, can someone help just convert SQL query to laravel query? here

Laravel Eloquent Join Using Another table

Hi how to convert this SQL query to Laravel Eloquent? I have three table: payments, devices and users. Payments table does not store user_id. but table has device_id. And device table also has user_id. I want to get user name which made payment. Answer it’s very easy Another way is: We have three models…

How do I catch a query exception in laravel to see if it fails?

All I’m trying to do is verify a query. Without that erroring out, I’d like to know it failed so I can return a response that states “Error: table does not exist” or the generic error. Answer The simplest way to catch any sql syntax or query errors is to catch an IlluminateDatabaseQuer…