Call to undefined method Database\Seeders\ in Laravel 8 db:seed

Ask New Question
  • Call to undefined method Database\Seeders\ in Laravel 8 db:seed

    I am trying to run the the db:seed command in Laravel 8 and getting the following error:

    ———-

    Class ‘Database\Seeders\expense’ not found

    at D:\wamp64\www\lara8\database\seeders\ExpenseSeeder.php:17

    13▕      */

    14▕     public function run()

    15▕     {

    16▕         //

    ➜  17▕         expense::factory()->times(10)->create();

    ————

    Please help me to fix the issue

    Reply
1 Replies Reply
  • Author
    Replies
  • |  

    Make sure that model name is correct everywhere. And if everything is okay then I am sure you are not using the

    use App\Models\expense;

    So use the above line in your expenseSeeder.php and let us know if it fix this issue?

     

    Reply
Viewing 1 replies (of 1 total)
Reply To: Reply #50486 in Call to undefined method Database\Seeders\ in Laravel 8 db:seed
Your information: