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

Validation from \Config\Services::validation() is no longer worked in frontend after implementing Myth/Auth #395

Closed
Wavesolid opened this issue Jul 1, 2021 · 2 comments

Comments

@Wavesolid
Copy link

Wavesolid commented Jul 1, 2021

let say i have this method in my backend code, but whenever i tried to render the errors using <?= validation->listErrors(); ?> in my frontend page, it showed nothing. Before i implemented Myth/Auth to my project, i can render the Error in my html.

image

@MGatner
Copy link
Collaborator

MGatner commented Jul 2, 2021

I can't say for sure what is causing this but I will say this: your last line serialized the entire Validation instance into SESSION, which will require un-serialized it on the next page load. It is very possible something is getting lost/corrupt in this transition. I would advise passing something simpler, like with('errors', $validation->listErrors())

@Wavesolid
Copy link
Author

Wavesolid commented Jul 2, 2021

i solved it but i don't know why. Actually i just need to change into return redirect()->to('/comics/create)->withInput(); only and i can delete those $validation. Before i install Myth/Auth in my project, this code seems fine. But after i installed it i don't need ->with('validation', $validation); anymore. Anyway, thanks for your reply, we can close this issues.

@MGatner MGatner closed this as completed Jul 2, 2021
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