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.

asked Mar 29, 2018 at 13:55
5
  • what is the file size of your seeder? Commented Apr 1, 2018 at 7:37
  • seeder is about 5.5Gb Commented Apr 2, 2018 at 15:04
  • the file is too large, try to import through command or import it batch by batch Commented Apr 2, 2018 at 16:42
  • "batch by batch" will take a huge amount of time, but what do you mean by "import through command"? Commented Apr 3, 2018 at 14:15
  • insert batch by batch (stackoverflow.com/questions/6889065/…), insert through command (stackoverflow.com/questions/4546778/…) Commented Apr 3, 2018 at 14:42

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.