Support the ongoing development of Laravel.io →
Configuration Security Requests
Last updated 2 years ago.
0

Try with the name "_token" than "csrf-token"

0

Response::json($data), no longer works too. By default eloquent now returns json. So something like:

class UserController {

protected $userModel;

public _construct(User $userModel)
{
    $this->userModel = $userModel;
}

public function getUserById($id)
{
    return $this->userModel->find(1)->get();  // would return the json data
}

0

Thank you, othmanus, for the help.... actually, the name had nothing to do with it. I actually overlooked something so simple. I found that my problem was caused because I was calling $.ajaxSetup() before loading jQuery in my layout file.
loaded my javascript files first, now it works as expected.

n0per, I will keep an eye on Response::json($data).

I truly appreciate all the help. Thanks!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.