code: public static function login($rank = 1, $id = null)
      {
          static::provider()->set('valid', true);
          static::provider()->set('rank', $rank);
          static::provider()->set('id', $id);
  
          return static::user();
      }
docs: Log user in session
  
  @param int $rank
  @param string $id
  @return object