当前位置: 动力学知识库 > 问答 > 编程问答 >

Laravel 4 - get returns all entities

问题描述:

I have had an issue occur multiple times within my Laravel project. Basically, I create an object using the Model::create() function. Then, when I return the model as JSON, I use Laravel's eager loading function to return the model. I use the following line(s) to return the model:

$event = Social_Event::create(array(

'creator_id' => Auth::user()->id

) + Input::all());

return Response::json(array(

'event' => $event

));

With that, I get a JSON encoded list of every existing conversation. I have never had that issue before. Does anyone see a cause for it?

分享给朋友:
您可能感兴趣的文章:
随机阅读: