I am using the FactoryModel tool to populate the database, for this I did the following:
I created the model: Php artisan make:model “Users” –m
I made the migration: php artisan migrate
Users Model
{
use Authenticatable, Authorizable, CanResetPassword;
protected $table = 'users';
protected $fillable = ['name', 'email', 'password','type'];
protected $hidden = [
'password', 'remember_token',
];
}
in ModelFactory.php;
$factory->define(App\User::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->safeEmail,
'password' => bcrypt('123'),
'type' => 'administrador',
'remember_token' => str_random(10),
];
});
in dataseSeeder.php;
public function run()
{
model::unguard();
factory('App\User','Administrador',3)->create();
model::reguard();
}
people BD: php artisan db: seed
ERROR:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'model' not found