src/Http/AccessToken.php
public static function generate($userId, $lifetime = 3600)
    {
        $token = new static;

        $token->token = str_random(40);
        $token->user_id = $userId;
        $token->created_at = Carbon::now();
        $token->last_activity_at = Carbon::now();
        $token->lifetime_seconds = $lifetime;

        return $token;
    }
public static function generate($userId, $lifetime = 3600)
    {
        $token = new static;

        $token->token = str_random(40);
        $token->user_id = $userId;
        $token->created_at = Carbon::now();
        $token->last_activity_at = Carbon::now();
        $token->lifetime_seconds = $lifetime;

        return $token;
    }
public static function generate ( $ userId , $ lifetime = 3600 ) { $ token = new static ; $ token -> token = str_random ( 40 ) ; $ token -> user_id = $ userId ; $ token -> created_at = Carbon :: now ( ) ; $ token -> last_activity_at = Carbon :: now ( ) ; $ token -> lifetime_seconds = $ lifetime ; return $ token ; }
Generate an access token for the specified user.

@param int $userId
@param int $lifetime
@return static
Generate an access token for the specified user .