0

I get an error "Class does not exist" when trying to populate my DB by executing
"php artisan seed:db".

UserMoviesSeeder.php in the folder database/seeds has the following content:

<?php

use Illuminate\Database\Seeder;
use App\Project;
use App\UserMovie;
use App\User;

class UserMoviesSeeder extends Seeder
{
    public function run()
    {
      $this->call(ProjectsTableSeeder::class);
    }
}

class ProjectsTableSeeder extends Seeder {

   public function run()
   {
       DB::table('user_movies')->delete();
       DB::disableQueryLog();

       UserMovie::create([
           'user_id' => 1734805,
           'tmdb_id' => 100,
           'ratio' => 4
       ]);

       UserMovie::create([
           'user_id' => 716091,
           'tmdb_id' => 100,
           'ratio' => 4
       ]);

       // ... and so on
   }
}

I run the command:

php artisan db:seed --class=UserMoviesSeeder

And I get an error:

In Container.php line 752:
Class UserMoviesSeeder does not exist

I tried the following:

composer dump-autoload

It returns:

VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.

VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.

If I rename both, the file and the class to standard name "DatabaseSeeder" and run the command:

php artisan db:seed

Then I have an error:

 Out of memory (allocated 547356672) (tried to allocate 1073741824 bytes)

I assume that 547356672 is the size of my seeder file (it is about 5.5Gb).
But why it tries to allocate twice more 1073741824 ?
I have only 8Gb of RAM, so it can't allocate 10Gb.
Previously I had 10Gb seeder in this folder, but now I have just one seeder file of 5.5Gb there.

0 Answers0