I'm following the docs to seed the users table, which shows User::create being used
class UserTableSeeder extends Seeder {
public function run()
{
DB::table('users')->delete();
User::create([
'username' => 'test',
'firstname' => 'Test',
'lastname' => 'Test',
'email' => 'test@domain.com',
'password' => Hash::make('test'),
'role' => 'user'
]);
}
}
But it keeps saying:
PHP Fatal error: Class 'User' not found in /home/vagrant/projects/roopla/database/seeds/UserTableSeeder.php on line 17
I thought maybe I need to make:model using artisan for User, but it already exists. Can anyone point me in the right direction I'm only just starting out with Laravel and piecing it together through Laracast and the docs, but there's no Laracast on seeding for 5.0. It doesn't seem like you can generate seeds now as artisan doesn't recognize generate:seed