2017-04-05 171 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中找到這個解釋