在Laravel 5.5中找不到驱动程序错误

时间:2017-12-07 06:50:07

标签: driver laravel-5.5 laravel-seeding

我在尝试运行php artisan db:seed 时遇到以下错误。我之前运行了composer updatecomposer dump-autoload

enter image description here

user.php的

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Passport\HasApiTokens;

class User extends Authenticatable
{
    use Notifiable, HasApiTokens;
    protected $fillable = ['name', 'email', 'password',];
    protected $hidden = ['password', 'remember_token',];
}

Address.php

use Illuminate\Database\Eloquent\Model;

class Address extends Model
{
    protected $fillable = ['user_id', 'name', 'address','mobile_no','image','email'];

    public function users() {
        return $this->hasOne(User::class);
    }
}

DatabaseSeeder.php

class DatabaseSeeder extends Seeder
{
    public function run()
    {
        $this->call(UsersTableSeeder::class);
        $this->call(AddressessTableSeeder::class);
    }
}

UsersTableSeeder.php

class UsersTableSeeder extends Seeder
{
    public function run()
    {
        factory(App\User::class,10)->create();
    }
}

AddressessTableSeeder.php

class AddressessTableSeeder extends Seeder
{
    public function run()
    {
        factory(\App\Address::class, 50)->create()->each(function ($u) {
            $u->users()->save(factory(App\Post::class)->make());
        });
    }
}

这是我的模型和播种器文件。我无法找出错误出现的原因。

0 个答案:

没有答案