0

I’m creating a blog in Laravel framework everything was going right until I tried to seed the database, I type this command in two ways and the following errors appear

c:\wamp64\www\my-blog>\App\Models\BlogPost::factory()->times(10)->create();
The system cannot find the path specified.

c:\wamp64\www\my-blog\app\Models>BlogPost::factory()->times(10)->create();
The filename, directory name, or volume label syntax is incorrect.

please help me

this command that caused this error it had to generate 10 blog posts and save them to the database and generate 10 users too, each user will own one blog post. but this didn’t work

haya
  • 1
  • 1
  • https://laravel.com/docs/10.x/seeding#using-model-factories not sure about your laravel version, but in 10 it is ->count(x). Also you need php artisan migrate to be ran before you can seed. – marius-ciclistu Apr 23 '23 at 19:54
  • Thank you so much..actually I'm using laravel version 9 but I will try this way – haya Apr 24 '23 at 14:06

0 Answers0