R
R
Romi2021-12-23 20:06:05
RESTful API
Romi, 2021-12-23 20:06:05

What and how is it generally accepted to return from the destroy () function of the controller for the API, can you give an example?

I'm just returning now, but doubts about the code and in general gnaw at me :) Is there any generally accepted standard?

return response('Удалено', 404);


Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pLavrenov, 2021-12-24
@pLavrenov

return response()->json([
    'success' => $repository->delete($id),
]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question