-
-
Notifications
You must be signed in to change notification settings - Fork 614
CORS doesn't works when I'm trying to dd()
, dump()
.
#521
Comments
same if i remove dd its run perfectly. did you find any solution ? |
There is solution in my message above. You need to add 2 functions |
works very well, thx! |
Thanks! Works like charm! |
All requests works fine until I'm not trying to
dd()
,dump()
I had read several treads and didn't found solution for me, so maybe this will helps.
This is doc quote from here https://packagist.org/packages/barryvdh/laravel-cors
If you echo(), dd(), die(), exit(), dump() etc in your code, you will break the Middleware flow. When output is sent before headers, CORS cannot be added. When the scripts exits before the CORS middleware finished, CORS headers will not be added. Always return a proper response or throw an Exception.
To solve it In my case I had simply added 2 helpers and added it in
composer.json
composer.json
app/Helpers/helpers.php
P.S. I don't know how to use issue form correctly so I hope that I didn't broke any rules. Just wanted to help
The text was updated successfully, but these errors were encountered: