public function destroy() { $this->service->destroy(scrud()->params()->all()); return response()->json([], 204); }
public function store() { $data = $this->service->create(scrud()->params()->all()); return response()->json($this->toArray($data), 201); }
public function selectSearch($service) { $data = $service->search(scrud()->paramsSearch()->all()); return response()->json($this->toArray($data), 200); }
public function update() { $updated = $this->service->update(scrud()->params()->all()); return response()->json([], $updated ? 204 : 200); }
public function show() { $data = $this->service->read(scrud()->params()->all()); return response()->json($this->toArray($data), 200); }