valid([ "name" => "required", "tax_no" => "", "department" => "", "tel" => "", "address" => "", "linkman" => "", ]); return $this->ok(app(CompanyService::class)->company(Auth::user(), $params)); } public function fav() { $params = $this->valid([ "page_size" => "", ]); return $this->ok(app(FavService::class)->paginate(Auth::user(), $params)); } public function favDel() { $params = $this->valid([ "ids" => "array|required", ]); return $this->ok([ "row" => UserFav::whereIn("id", $params['ids'])->where("user_id", Auth::id())->delete(), ]); } public function address() { $params = $this->valid([ "page_size" => "", ]); return $this->ok(app(AddressService::class)->paginate(Auth::user(), $params)); } public function addressDel() { $params = $this->valid([ "id" => "required", ]); $row = UserAddress::where("user_id", Auth::id())->where("id", $params['id'])->delete(); return $this->ok([ "row" => $row, ]); } public function addressStore() { $params = $this->valid([ "id" => "int", "is_default" => "", "name" => "required", "address" => "required", 'phone' => "required", "area" => "required", ]); return $this->ok(app(AddressService::class)->store(Auth::user(), $params)); } }