在null上调用成员函数define() - Laravel

时间:2017-09-24 17:20:11

标签: php laravel

我收到错误:Call to a member function define() on null

这是我的代码:

$factory->define(App\User::class, function (Faker $faker) {
    static $password;

    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => $password ?: $password = bcrypt('secret'),
        'remember_token' => str_random(10),
    ];
});

1 个答案:

答案 0 :(得分:-1)

得到答案我只需要包含html表单别名和包..