Skip to content

There is a problem with calling Validation via a variable #233

Answered by romalytvynenko
salawatbro asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @SalawatJoldasbaev

Can you try it like this?

$request->validate(($data = app(ActivityStore::class))->rules());

The trick here is making sure to pass rules in a way so eval will work for them: https://scramble.dedoc.co/usage/request#rules-evaluation-caveats

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@WildEgo
Comment options

@CristianHG2
Comment options

@CristianHG2
Comment options

@WildEgo
Comment options

Comment options

You must be logged in to vote
1 reply
@salawatbro
Comment options

Answer selected by salawatbro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants