正如tittle所说,这是我的控制器
原文链接:https://www.f2er.com/laravel/133118.html$book = Data::where('userId','1')->paginate(3); return response()->json($book);
并获取这样的json数据:
data:[{id: 1,userId: 1,vendorId: 1,name: "Alfreda Berge PhD",phone: "1-850-813-5950 x96169",…},…] from:1 last_page:2 next_page_url: "http:/localhost/XX/public/user/book/list/1?page=2" perpage:4 prev_page_url:null to:4 total:5 // if I want to add a new column and value here,what should I do?
我试着这样做:
$book = Data::where('userId','1')->paginate(3); $book->printWord = 'Hellow!'; return response()->json($book);
但是,它似乎将删除列printWord.
任何的想法?