I created a new project using lumen 5.5 to test out JWT.
While running the seeder, the users table get populated correctly. However, any other class throws an error saying:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'App\Patient' not found
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'App\Purchase' not found
I've run composer dump-autoload but it still does not help.
Here is the code in the ModelFactory.php:
$factory->define(App\Patient::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->email,
'password' => app('hash')->make('hello123'),
];
});
$factory->define(App\User::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->email,
'password' => app('hash')->make('hello123'),
];
});
$factory->define(App\Purchase::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->email,
];
});
Here is the code for the DatabaseSeeder.php
$this->call(UsersTableSeeder::class);
$this->call(PurchasesTableSeeder::class);
$this->call(PatientsTableSeeder::class);
The code for UsersTableSeeder.php
factory(App\User::class, 10)->create();
The code for PatientsTableSeeder.php
factory(App\Patient::class, 10)->create();
What am i doing wrong here?