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

4xjbh's avatar
Level 4

Email validation required why?

I have this on my ContactRequest object. But when I save the form the it always forces the email to be required. I thought this should just validate the format of the email address unless it has the required option.

Can someone please clarify this. TY.

        return [
            'first_name' => 'required',
            'last_name' => 'required',
            'email' => 'email'
        ];
0 likes
2 replies
Nakov's avatar
Nakov
Best Answer
Level 73

Because you are not allowing to be empty that way.. You should add

nullable|email as rules

munazzil's avatar

Yes that email mention as [email protected] without @ mark it not you too move forward, use sometimes else remove the vaidation,

          'email' => 'sometimes'

else use below one,

          'email' => 'nullable'

Please or to participate in this conversation.