app/Services/UserService.php
public function findByIdentifier($identifier): ?User
    {
        return DB::table('user')
            ->where('user_name', '=', $identifier)
            ->orWhere('email', '=', $identifier)
            ->get()
            ->map(User::rowMapper())
            ->first();
    }
public function findByIdentifier($identifier): ?User
    {
        return DB::table('user')
            ->where('user_name', '=', $identifier)
            ->orWhere('email', '=', $identifier)
            ->get()
            ->map(User::rowMapper())
            ->first();
    }
public function findByIdentifier ( $ identifier ) : ? User { return DB :: table ( 'user' ) -> where ( 'user_name' , '=' , $ identifier ) -> orWhere ( 'email' , '=' , $ identifier ) -> get ( ) -> map ( User :: rowMapper ( ) ) -> first ( ) ; }
Find the user with a specified user_name or email address.

@param string $identifier

@return User|null
Find the user with a specified user_name or email address .