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
}
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!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community