Skip to content

PHP code snippet – How to validate email or phone number single parameter request in laravel?

protected function credentials(Request $request)
            return ['phone'=>$request->get('phone'),'password'=>$request->get('password')];
          elseif (filter_var($request->get('email'), FILTER_VALIDATE_EMAIL)) {
            return ['email' => $request->get('email'), 'password'=>$request->get('password')];
          return ['username' => $request->get('username'), 'password'=>$request->get('password')];
See also  Python code snippet - How to host a discord bot on a rasberry pi?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.