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