laravel-rest
laravel-rest copied to clipboard
Add default StoreCommand and UpdateCommand
Hello, I've just added this default commands, these are matching a very simple implementation that I'll use in a project I'm working on. I'm not taking into account field validation, I think later can be added by telling to the user to specify $rules
array in the model and as the name says these are just default implementations, is up to the user write it's own implementation to satisfy his needs.
I've tried to follow best REST practices but I don't know if it's ok, i.e when creating a new resource (POST) a 201 is returned with no body and the Location
header set, however I don't know if the Location
header value can be a simple uri (/resource/id
) or it needs to be a complete url (http://...
).
Another thing I don't know is what body does the response from a PUT request needs to have? I just returned the $model->update()
, but I don't know if the resource should be returned or if the body needs to be empty.
What do you think?
Thanks.