If you want to quickly output an Eloquent query in its SQL form, you can invoke the toSql() method onto it like so
1$invoices = Invoice::where('client', 'James pay')->toSql();2 3dd($invoices)4// select * from `invoices` where `client` = ?
Tip given by @devThaer