@wallyj how are you editing the file? I guess you're logged in via an app rather than using ssh, because if you had that you'd be able to do your fixes locally and push them up?
Error on line that has been edited/fixed
I have a particular project that I work on where I make edits live on the server... I know... let the flaming begin. Without going into particulars, for this project, it has to be this way.
So, sometimes I edit a file, refresh, and it works fine. Other times, like today, I will edit a line, and make a mistake, and as expected, I receive an error on the screen, but when I make the change to fix it, I still get the error, but the line is different, no longer containing the function that could even cause the error.
For instance,
I wrote this line of code as part of a query to restrict records by date:
->whereBetween('renewaldate', [$fromdate, $todate])
It worked just fine. But then I wanted to change the query to actually look for a particular date, instead of a range, so I hastily changed the code to this:
->whereBetween('renewaldate', "2020/08/31")
Which of course produced this error:
Argument 2 passed to Illuminate\Database\Query\Builder::whereBetween() must be of the type array, string given, called in...
Which makes sense because I didn't change the function to "where" rather than "whereBetween", as "whereBetween" requires two dates.
So I made the change to:
->where('renewaldate', "2020/08/31")
Saved the file and refreshed.
Same error. Wait, what? So I clicked on "Application Frames" under the error to see my line of code on the right section of the browser that is causing the problem.
It's the new line. The line highlighted is this:
->where('renewaldate', "2020/08/31")
A "whereBetween" error on a line that no longer says "whereBetween".
The weird part is that if I wait a few minutes and refresh again, the query works fine with no "whereBetween" error.
I thought it was my hosts' caching, and they suggested it had something to do with nginx, but I'm befuddled. This happens regularly. Is this a hosting thing, a Laravel thing?
Any ideas?
Please or to participate in this conversation.