Comments (7)
I can confirm that it does work with my current Laravel 5 installation.
The problems that I did encounter were as a result of my javascript calls.
I'm running nginx/hhvm and did not need to make any server configuration changes.
from laravel-cors.
I have it up and running with Laravel 5 as well. Working great. What is the error you are receiving?
from laravel-cors.
I'm getting the following error. I'm using an angular project to make the call.
I'm using the default cors.php configuration file with L5
XMLHttpRequest cannot load http://localhost:8000/api/auth/staff. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. The response had HTTP status code 500.
from laravel-cors.
I figures it out. It was because of my CSRF token mismatch
from laravel-cors.
@sicsol can you explain what you did?
from laravel-cors.
in kernel.php i did the following
under protected $middleware
i commented out
// 'App\Http\Middleware\VerifyCsrfToken',
under protected $routeMiddleware
i added a new filter name
'csrf' => 'App\Http\Middleware\VerifyCsrfToken',
from laravel-cors.
See https://github.com/barryvdh/laravel-cors#disabling-csrf-protection-for-your-api
from laravel-cors.
Related Issues (20)
- [Solution] Add exception handler cross domain for laravel 8.x HOT 2
- Multiple CORS header ‘Access-Control-Allow-Origin’ not allowed HOT 1
- Laravel 8 Error Cors HOT 2
- Cannot set the same Access-Control-Allow-Headers values in apache setting? HOT 1
- 500 Error Class "Fruitcake\Cors\CorsServiceProvider" not found HOT 2
- Cors not working with POST request with Docker and Nginx HOT 3
- Specify domain for paths HOT 2
- CORS configuration per route HOT 1
- Middleware API POST request with CORS issue (Passport and Auth0) HOT 1
- how to return or expose these Access-Control-Allow-Methods and Access-Control-Allow-Headers ?
- Laravel cors are not returned HOT 3
- Add laravel9 support HOT 4
- v2.1.0 it's a breaking change HOT 7
- Composer error upon installing in Laravel 7
- How to add add Access-Control-Allow-Origin to error 500 response
- PHP 8.1 Passing null to parameter #1 ($haystack) of type string is deprecated
- How to block Cors on a same subdomain
- strpos(): Argument #1 ($haystack) must be of type string, array given on \vendor\fruitcake\laravel-cors HOT 2
- Access-Control-Allow-Origin is missing laravel-9 and vuejs3
- Composer error upon installing in Laravel 9 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-cors.