Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Bakasta's avatar

whether the request form can only validate using the rules listed, if not how to make the costum validation?

how make conditional validation like this on form request :

if($request->id == session('current_id')){ return true; }

0 likes
3 replies
Bakasta's avatar

@snapey i want to validate $request->id is it the same as the id that I saved earlier in the session

Snapey's avatar

Why not just use the id in the session and remove the one from the form. Then it cannot be tampered with and does not need validating.

Please or to participate in this conversation.