When running php artisan migrate --seed
, this error appears:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'CreateCharactersTable' not found.
Here is that that class:
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class CharacterSeeder extends Seeder
{
public function run()
{
DB::table('characters')->delete();
DB::table('characters')->insert([
'user_id' => 999,
'name' => 'Susan Strong',
'race' => 'orc',
'class' => 'assassin',
'image_location' => null,
'combat_level' => '0',
'base_str' => 6,
'base_int' => 4,
'base_apt' => 5,
'mod_str' => 9,
'mod_int' => 5,
'mod_apt' => 7,
'xp_str' => 1,
'xp_int' => 2,
'xp_apt' => 1,
'is_bot' => 1,
'created_at'=> '2017-04-02 17:53:02',
'updated_at'=> '2017-04-02 17:53:02'
]);
DB::table('characters')->insert([
'user_id' => 4,
'name' => 'Chale',
'race' => 'elf',
'class' => 'scholar',
'image_location' => null,
'combat_level' => '0',
'base_str' => 3,
'base_int' => 7,
'base_apt' => 5,
'mod_str' => 6,
'mod_int' => 10,
'mod_apt' => 6,
'xp_str' => 1,
'xp_int' => 2,
'xp_apt' => 1,
'is_bot' => 1,
'created_at'=> '2017-04-02 17:53:02',
'updated_at'=> '2017-04-02 17:53:
}
}
?>
and the seeder:
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Database\Seeds\CharacterSeeder;
use Database\Seeds\ClassesTableSeeder;
use Database\Seeds\RacesTableSeeder;
use Database\Seeds\UserTableSeeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->call(UserTableSeeder::class);
$this->call(CharacterSeeder::class);
$this->call(RacesTableSeeder::class);
$this->call(ClassesTableSeeder::class);
}
}
Running composer dumpautoload
passes but does not remove the error. When it was only two seeders, User and Character, it ran well. Despite looking over the new seeders again and again, I cannot determine the error involved.
Any suggestions to get the seeder to run?
Thank you.