diff --git a/src/Someline/Repository/Controllers/BaseController.php b/src/Someline/Repository/Controllers/BaseController.php index 1516f0c..ffa41ef 100644 --- a/src/Someline/Repository/Controllers/BaseController.php +++ b/src/Someline/Repository/Controllers/BaseController.php @@ -32,15 +32,22 @@ public function show(Request $request, $id) public function store(Request $request) { $data = $request->all(); + $data = $this->handleData($request, $data); return $this->repository->save($data)->present(); } public function update(Request $request, $id) { $data = $request->all(); + $data = $this->handleData($request, $data, $id); return $this->repository->update($id, $data)->present(); } + protected function handleData(Request $request, $data, $id = null): array + { + return $data; + } + public function destroy(Request $request, $id) { return $this->repository->destroy($id)->present();