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

@param string $user_name

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