codecasts / spa-starter-kit

A highly opinionated starter kit for building Single Page Applications with Laravel and Vue.js
MIT License
913 stars 134 forks source link

CRUD actions return with fresh record #94

Closed vinicius73 closed 7 years ago

vinicius73 commented 7 years ago

API actions like webservice/app/Http/Controllers/CategoriesController.php#L43 returna only a success message

Category::create($request->only('name'));

return $this->response->json([
   'result' => 'success',
]);

But will be more useful if the response contains the new record's data

flyingluscas commented 7 years ago

@vinicius73 I was thinking about that too, and also about return the right status codes, like when creating something return a 201 status code instead a 200, I can implement that :)

vedovelli commented 7 years ago

Closed by #97