如何在Laravel中使用package(GImei)?

时间:2019-12-11 01:20:49

标签: laravel package

我想做什么

我要使用这个包,Gimei https://github.com/tomohiro/gimei

  1. 我安装了composer require tomohiro/gimei
  2. 我曾经这样使用
use App\Client;
use Gimei;

public function ClientsTableSeeder 
{
    $name= Gimei::name();

    $clients = [
        [
            'id' => 1,
            'name' => $name->kanji;,
            'kanaName' => $name->katakana,
        ]
    ];
    Client::insert($clients);
}

发生错误

Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("The use statement with non-compound name 'Gimei' has no effect", "/app/database/seeds/ClientsTableSeeder.php"
, ["/app/vendor/composer/../../database/seeds/ClientsTableSeeder.php"])

请帮助我。

0 个答案:

没有答案