I'm new to Laravel, When I run php artisan db:seed i recieve the following message:
[ReflectionException] Class DatabaseSeeder does not exist
I already have run composer dump-autoload sadly without any result. My class is located in the default folder /seeds
The code from the class:
<?php namespace database\seeds;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use App\User;
use App\Country;
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call('CountryTableSeeder');
$this->call('UserTableSeeder');
}
}
class UserTableSeeder extends Seeder {
public function run() {
DB::table('users');
User::Create(['username' => 'Bart', 'email'=>'[email protected]', 'password' => Hash::make('password')]);
}
}
class CountryTableSeeder extends Seeder {
public function run() {
DB::table('country');
Country::Create(['country_name' => 'Nederlander']);
}
}
What I'm doing wrong?
namespace database\seeds;
at the top – JoeCoder