all()); $list = $query->paginate(Paginator::resolvePerPage('per_page', 20, 50)); return $this->json(FriendLinkResource::collection($list)); } public function store(FriendLinkRequest $request){ $input = $request->input(); $friendLink = FriendLink::create($input); (new OperationLogService())->inLog(OperationType::Create, '', $friendLink, $request->input()); return $this->success('添加成功'); } public function show(FriendLink $friendLink){ return $this->json(FriendLinkResource::make($friendLink)); } public function update(FriendLink $friendLink, FriendLinkUpdateRequest $request){ $friendLink->update($request->input()); (new OperationLogService())->inLog(OperationType::Update, '', $friendLink, $request->input()); return $this->success('修改成功'); } public function destroy(FriendLink $friendLink){ $friendLink->delete(); (new OperationLogService())->inLog(OperationType::Delete, '', $friendLink); return $this->success('删除成功'); } }