1 2 3 4
$token = \Illuminate\Container\Container::getInstance() ->make(\Laravel\Passport\PersonalAccessTokenFactory::class) ->make(null, 'My token name', ['myscope']) ->accessToken;