2017-04-05 175 views
0

我已经安装了laravel 5.4,而Ramsey Uuid已经在其中,我尝试使用它。以下是代码Ramsey Uuid不适用于新安装的laravel 5.4

HomeController.php

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

但它给我下面的错误。

捕捉到异常:当 32位系统上调用 拉姆齐\ UUID \转换器\时间\ DegradedTimeConverter :: calculateTime,Moontoast \数学\ BigNumber必须存在。

我已经安装了拉姆齐/ UUID版本3.6.1

任何建议请,有什么能解决?

+0

你看到了吗? https://github.com/ramsey/uuid/issues/76 –

+1

你可以在作曲家https://github.com/moontoast/math添加需求它可能有帮助但不确定 –

+0

是的我读过https://github.com/ramsey/uuid/issues/76但不明白我需要做什么。我一周前从git克隆了 – Jass

回答

2

Laravel 5.4没有任何问题。你应该通过执行

composer require "moontoast/math" 

这个错误发生的原因安装https://github.com/moontoast/math是你的环境不支持大的整数(32位操作系统等)。你可以在代码ramsey/uuid中找到这个解释