班级'用户'在运行工匠迁移时找不到

时间:2015-05-29 20:01:24

标签: php laravel laravel-5 artisan artisan-migrate

我正在尝试运行

project$ php artisan migrate:refresh

但得到错误

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Users' not found

为什么我需要Users课程?我已经有app/User.php

<?php namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract {

[...]

和我的迁移database/migration/2015_05_27_143124_create_users_table

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('username')->unique();
            [...]
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    [...]

我的config/auth.php也有'model' => 'App\User'。我试过运行project$ composer dump-autoload。正在定义User类。为什么我需要Users课程?

1 个答案:

答案 0 :(得分:0)

固定。我放弃了我的数据库并继续创建了一个同名的新数据库,然后:

val animals = List("penguin","ferret","cat").toSeq
val rdd = sc.makeRDD(animals, 1)