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