$this->auth() ]; $fields = ['*']; $sort = '`id` desc'; $page = request('page', 1); $limit = request('limit', 20); return ThisFacade::getList($conditions, $fields, $sort, $page, $limit); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $data = $request->all(); $data['uid'] = $this->auth(); return ThisFacade::create($data); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $conditions = [ 'id' => $id, 'uid' => $this->auth() ]; $fields = ['*']; return ThisFacade::findBy($conditions, $fields); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $data = $request->all(); $conditions = [ 'id' => $id, 'uid' => $this->auth() ]; return ThisFacade::updateBy($conditions, $data); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $conditions = [ 'id' => $id, 'uid' => $this->auth() ]; return ThisFacade::deleteBy($conditions); } }