I just noticed that DB::raw does not return any error, DB::statement (and other cdes) does.
There should be an explanation in the code, but I did not find any note about this in the documentation, neither in the web. Does sb have more information?
The former creates an in-memory Expression object which you can use in your queries whereas the latter immediately executes any statement/expression you pass along.
Thanks @mabdullahsari for the explanation, can you point me/us where this is explain in the doc and if the doc talks about the difference in exception handling?
I really appreciate Laravel and its documentation.
In this particular case I should add a 2nd remember in bold "In addition of SQL injection vulnerability, be aware that raw expression does not throw exception.
And, personally, I'll replace all my "raw" by "statement"