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

Did not work as expected #1

Open
angelside opened this issue Mar 24, 2014 · 3 comments
Open

Did not work as expected #1

angelside opened this issue Mar 24, 2014 · 3 comments

Comments

@angelside
Copy link

Additional methods not work for me. Error message is "ModelNotFoundException", this is my Model::findOrFail() on show() method.

For sample not run confirm method, it's seek "confirm" as resource id and there is no id "confirm".

@revati
Copy link
Owner

revati commented Mar 29, 2014

ModelNotFoundException is thrown when Model::findOrFail.
Correct me if i am wrong.

Didn't quite catch that:
For sample not run confirm method, it's seek "confirm" as resource id and there is no id "confirm".

Could you please explain in more detail, so i could fix this isue.

@angelside
Copy link
Author

Real problem is "trash". "trash" and "show" is conflict but not always. "/resource/{resource}" and "/resource/trash", because there is no id number "trash". This trigger my ModelNotFoundException.

I think this is a loader some order problem.

I create a similar package in. app/App/Route. If add namespace to composer.json with PSR-0, sometimes run sometimes not run. I fix; this way, open autoload_namespaces.php and move my App/Route namespace at top. At the last I add this namespace with PSR-4, now always work.

And I move "trash" to before "show" in code, $resourceDefaults.

@revati
Copy link
Owner

revati commented Mar 31, 2014

Could it be as simple as to put ->where('id', '[0-9]+');

so trash will never be match for that pattern,
or even better way would be to make trash method go before show...

Thanks for feedback, will try to find time and fix it till weekend.

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

No branches or pull requests

2 participants