Logging in with multiple types of info
Since this is the backend to a login request, I assume that you expect just 2 inputs, the password and one of the others.  So why not use the following:

//gets an array of all inputs: email &amp; pass or ssn &amp; pass or phone &amp; pass...    
$credentials = $request-&gt;all(); 

try{
    if(!$token = JWTAuth::attempt($credentials)){
        return response()-&gt;json(['error' =&gt; 'invalid_credentials'], 401);
    }

} catch (JWTException $e){
    return response()-&gt;json(['error' =&gt; 'could_not_create_token'], 500);
}



  i would like to minimise my if and else what would you guys recommend?


Hint: If you find yourself doing something over and over and over, you probably need a loop. Since this is a login form and that you expect just 1 variable besides the password, don't have so many vars in your script: $email, $ssn, $pager, badgenumber, ophone, fphone, ssn... just use $identifier.  If you really need to cycle through all possibilities build an array and loop until you find the one the user submitted:

$possibilities = ['email','ssn','badgenumber','ophone'...];
$identifier = '';
foreach ($possibilities as $i){
    if($request-&gt;has($i)){
        $identifier = $request-&gt;input($i);
        break; //exit the foreach loop b/c we've found the identifier
    }
}
$credentials = [$identifier, $request-&gt;input('password')];


Then you can attempt to create the token with those credentials.  Beware I've never used Laravel, but I wrote my answer after going over this helpful page on how to access requests.

Quick sidenote: I notice that you have a check that can be true only if email has length &lt; 6, and another that can be true only if email has length > 6.  What if email has length===6 ?