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

Does "Request" have to be an instance of "Orion\Http\Requests\Request"? #45

Closed
ldiebold opened this issue Jan 28, 2021 · 3 comments
Closed

Comments

@ldiebold
Copy link

When hitting an Orion index route, I'm getting the error:

Argument 1 passed to Orion\\Http\\Controllers\\Controller::index() must be an instance of Orion\\Http\\Requests\\Request

Does this mean that we are unable to use laravels Illuminate\Foundation\Http\FormRequest class for requests?

If not, that's totally fine! Might just need to add that to the docs here:
https://tailflow.github.io/laravel-orion-docs/guide/security.html#authentication

@ldiebold
Copy link
Author

It might be a good idea to have an artisan command for requests:
php artisan orion:request or something like that!

@alexzarbn
Copy link
Member

Hi @ldiebold,

Yes, Request classes must extend Orion\Http\Requests\Request. It is, in fact, a normal Illuminate\Foundation\Http\FormRequest, just with a sprinkle of Orion methods for resolving validation rules of relation specific endpoints.

I have added a note about this to the Validation and Getting Started sections.

@ldiebold
Copy link
Author

Perfect. Thanks @alexzarbn

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