-1

After installing Telescope by running composer require laravel/telescope --dev on Laravel 6.0-dev,

when I'm going to publish it using php artisan telescope:install, I get the following error:

Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.

   InvalidArgumentException  : Length must be a positive integer.

  at C:\xampp\htdocs\homeefy\vendor\ramsey\uuid\src\Generator\CombGenerator.php:
63
    59|      */
    60|     public function generate($length)
    61|     {
    62|         if ($length < self::TIMESTAMP_BYTES || $length < 0) {
  > 63|             throw new \InvalidArgumentException('Length must be a positi
ve integer.');
    64|         }
    65|
    66|         $hash = '';
    67|

  Exception trace:

  1   Ramsey\Uuid\Generator\CombGenerator::generate()
      C:\xampp\htdocs\homeefy\vendor\ramsey\uuid\src\Generator\CombGenerator.php
:69

I'm using Laravel 6.0-dev and Windows 10 with XAMPP. PHP version is 7.3.8

What do I need to solve it? I can't find a solution in Google.

Inigo EC
  • 2,178
  • 3
  • 22
  • 31
  • I've no clue - I believe it came with the Laravel's Telescope package; I'm not familiar with that file at all – Inigo EC Aug 30 '19 at 17:30
  • Sorry, I saw after I asked for clarification that this was happening on the `install` command. This might be a better question for the `GitHub` issue page: https://github.com/laravel/telescope/issues – Tim Lewis Aug 30 '19 at 17:32
  • 2
    It looks like someone already brought it up. https://github.com/laravel/telescope/pull/712 – aynber Aug 30 '19 at 17:36

1 Answers1

0

I had same error. But, I fixed this by editing the framework

src\Illuminate\Support\Str.php.

Open the file and find the method

orderedUuid()

and use UuidFactory instead of Uuid for $factory variable.

You need to use Ramsey\Uuid\UuidFactory in file header.

 public static function orderedUuid()
{
    if (static::$uuidFactory) {
        return call_user_func(static::$uuidFactory);
    }

    //$factory = Uuid::getFactory();

    $factory = new UuidFactory();

    $factory->setRandomGenerator(new CombGenerator(
        $factory->getRandomGenerator(),
        $factory->getNumberConverter()
    ));

    $factory->setCodec(new TimestampFirstCombCodec(
        $factory->getUuidBuilder()
    ));

    return $factory->uuid4();
}