I’ve come across this one a couple of times over the last few months, each time, I’ve managed to dig around and fix it but I thought for my own sanity I’ll write it down and where better than here.
The issue comes about when I’ve just started a new Laravel project. I’ve set up all the authentication etc and run my migrations to create the user tables etc.
Now when I try to register for the first time, I can’t create the user record.
Just to make sure, before I make the big reveal, lets check a couple of things.
The big reveal I found was simply that I needed to restart php artisan serve. For some reason Artisan is perfectly able to talk to the database but the browser is not without a reload.
That is the part that utterly baffled me. Why was Artisan okay to migrate but the app cannot perform an INSERT.
So there we have it, I hope that helps someone else out there too!