Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why id is used in the Repository delete method #11

Open
clarkwinkelmann opened this issue May 19, 2017 · 2 comments
Open

Why id is used in the Repository delete method #11

clarkwinkelmann opened this issue May 19, 2017 · 2 comments
Labels

Comments

@clarkwinkelmann
Copy link
Member

A model reference is used to update, but only the id is given to delete.

There's even a find call to check the model exists in the controller https://github.com/gravure/laravel-json-api/blob/master/src/Controllers/ResourceController.php#L91

What's the reason behind sending only the id as parameter ? In order to use Eloquent's delete method we need to run find a second time !

@luceos
Copy link
Member

luceos commented May 20, 2017

Good point. Should be a model I guess.

@clarkwinkelmann
Copy link
Member Author

I've created an improved ResourceController on my own install, I'll submit it as a PR here so you can have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants