How to fix in laravel 5.2 zizaco entrust:migration class name validation?

前端 未结 4 662
北海茫月
北海茫月 2021-02-05 20:07

I have followed zizac/entrust installation tutorial from GitHub Link and faced with error:

Class name must be a valid object or a string in var/www/htm

4条回答
  •  我寻月下人不归
    2021-02-05 20:59

    in vendor/zizaco/entrust/src/commands/MigrationCommand.php on line 86

    remove line :

        $usersTable  = Config::get('auth.table');
        $userModel   = Config::get('auth.model');
    

    add line :

    $usersTable  = Config::get('auth.providers.users.table');
    $userModel   = Config::get('auth.providers.users.model');
    

    and config/auth.php file write provider line as like me :

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
            'table' => 'users',
        ],
    
        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],
    

    then your problem will solve : happy coding

提交回复
热议问题