Ramsey Uuid无法在新安装的laravel 5.4上运行

Jas*_*ass 2 php laravel-5.4

我已经安装了laravel 5.4,而Ramsey Uuid已经安装在其中,因此我尝试使用它。以下是代码

HomeController.php

use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
$uuid1 = Uuid::uuid1(); 
echo $uuid1->toString() . "\n";
Run Code Online (Sandbox Code Playgroud)

但这给了我以下错误。

捕获的异常:在32位系统上调用Ramsey \ Uuid \ Converter \ Time \ DegradedTimeConverter :: calculateTime时,必须存在Moontoast \ Math \ BigNumber。

我已经安装了ramsey / uuid版本3.6.1

请提出任何建议,什么是解决方案?

Dmi*_*yan 5

Laravel 5.4没有错。您应该通过执行以下命令安装https://github.com/moontoast/math

composer require "moontoast/math"
Run Code Online (Sandbox Code Playgroud)

发生此错误的原因是您的环境不支持大整数(32位操作系统等)。您可以在ramsey / uuid的代码中找到此说明