Install Laravel debugbar. It will let you check things like the session to see if anything is being set. Its only a 3 minute install.
Post reloads the page
Hello, I have an issue that I've never run into before and it's with code pulled from a git repo that is already working perfectly on a live server, but not on my local Laravel Homestead vm environment. When I try to log in, the login page reloads without errors and I am unable to dd($request) on the route in web.php.
This is not a csrf_field issue, as the exact same code that is there works on the live server. The csrf field exists on the login form, and appears to be rendering as it should. I am able to log into the live server.
To debug, I updated my login route in routes/web.php to this:
Route::post('login', function (Request $request) { return dd($request); });
... so that posting to the login url should just return the request object. It does not, but simply reloads the login page.
If I put the same thing on the GET login, like so:
Route::get('login', function (Request $request) { return dd($request); });
...and am able to view the request object as expected there.
If I view the routes list via php artisan route:list, the login route looks like: POST | login | | Closure | web
so route:list is not cached and shows the closure
My login form is the same as the one that is out of the box but design is modified (and as I said, the exact same form works on the production environment). I've tried to update the auth keys and re-seed the database afterwards with no luck.
I've deleted the cache many times with no luck. I re-installed the entire repo, still no luck.
The homestead box is the latest, and my laravel version is: Laravel Framework 5.5.40
I've never run into an issue where I am unable to capture the post request. Any help would be greatly appreciated.
Thank you, Jonathan
@SNAPEY - I managed to get this working without any issues using the 'Per Project Installation' listed here:
https://laravel.com/docs/5.5/homestead
Using those instructions, everything worked perfectly, although it redirected to https (which should only happen if it is a 'production' site). That was not a huge problem though as I was able to follow the instructions here:
https://medium.com/@adnanxteam/how-to-setup-https-with-laravel-homestead-ad7915470fa8
... which explains how to move and trust the certificate from the vagrant box
I will do per project installations from now on. I hope this helps anyone with the same issue.
Thanks Snapey and AliBayat for helping out.
Please or to participate in this conversation.