src/Repositories/UserRepository.php
public function byUsername($username, $with=[])
    {
        $user = $this->model->whereUsername($username);
        foreach($with as $relation)
            $user = $user->with($relation);
        return $user->first();
    }
public function byUsername($username, $with=[])
    {
        $user = $this->model->whereUsername($username);
        foreach($with as $relation)
            $user = $user->with($relation);
        return $user->first();
    }
public function byUsername ( $ username , $ with = [ ] ) { $ user = $ this -> model -> whereUsername ( $ username ) ; foreach ( $ with as $ relation ) $ user = $ user -> with ( $ relation ) ; return $ user -> first ( ) ; }
get a single user by its username

@param  string  $username
@return User
get a single user by its username