Code Monkey home page Code Monkey logo

Comments (7)

andybeak avatar andybeak commented on May 18, 2024

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.

esneeringer avatar esneeringer commented on May 18, 2024

I have it up and running with Laravel 5 as well. Working great. What is the error you are receiving?

from laravel-cors.

sicsol avatar sicsol commented on May 18, 2024

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.

sicsol avatar sicsol commented on May 18, 2024

I figures it out. It was because of my CSRF token mismatch

from laravel-cors.

juanmanavarro avatar juanmanavarro commented on May 18, 2024

@sicsol can you explain what you did?

from laravel-cors.

sicsol avatar sicsol commented on May 18, 2024

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.

barryvdh avatar barryvdh commented on May 18, 2024

See https://github.com/barryvdh/laravel-cors#disabling-csrf-protection-for-your-api

from laravel-cors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.