Laravel-cors

115 views
Skip to first unread message

noela...@ashdownx.com

unread,
May 21, 2019, 8:44:25 AM5/21/19
to PHP Desktop
I have installed Barryvdh\laravel-cors but my routes aren't working. I get a "No-Access-Allow-Origin header is present in the response" error with my get request changed to options and a status 200. However, when I run this program using laragon CLI 'php artisan serve' it works fine. What am I missing? I also tried adding headers in my index.php file but it still doesn't work

Czarek Tomczak

unread,
May 21, 2019, 9:10:44 AM5/21/19
to PHP Desktop

You could add "disable-web-security" switch in settings.json if other approaches fail. See the ChromeSettings wiki page.

noela...@ashdownx.com

unread,
May 21, 2019, 10:25:25 AM5/21/19
to PHP Desktop
I have googled it but no solution seems to work for me notably using middleware cors or adding headers to my index.php.

ndoh noela

unread,
May 21, 2019, 10:30:34 AM5/21/19
to PHP Desktop
Here is my logs file and error message shown in developpers tool. Also added "disable-web-security" to chrome  setings in settings.json but get same problem
laravel-2019-05-21.log
dev tools.PNG

Czarek Tomczak

unread,
May 21, 2019, 2:28:22 PM5/21/19
to PHP Desktop
You have PHP errors in the logs that you should fix. You should ask for help on a general PHP forum. If you want to configure PHP edit php/php.ini file, and if you want to replace PHP version shipped with PHP Desktop then see instructions on the KnowledgeBase wiki page.

noela...@ashdownx.com

unread,
May 22, 2019, 4:36:30 PM5/22/19
to PHP Desktop
I gave fixed the php errors, some syntax errors. My problem is the following, my project works perfectly when php artisan command is run but gives a 404 error not found when run with the .exe file. How can I solve this? Assuming the user does not know programming and needs a one-click launch app

noela...@ashdownx.com

unread,
May 22, 2019, 8:12:33 PM5/22/19
to PHP Desktop
Found a solution. Added index.php in my axios URL
Reply all
Reply to author
Forward
0 new messages