Sadly the url the $faker->image is using is down, so it won't work - the URL that's using is http://lorempixel.com
You can always import fake images to your storage and then randomly apply them - that's what I do.
I'm doing a project on Laravel 7 with FakerPHP, I want to populate my database with some random images and at the same time saving them on my local storage folder, but they can't get stored in the folder and I don't know why.
Here's my seeder:
for ($i=0; $i<20; $i++) {
$newApartment = new Apartment();
$newApartment->image = $faker->image('public/storage/images',300, 300);
$newApartment->save();
};
I want them to get stored on /images, but when I run the seeder no images is saved and when I check on my database all that appears is 0 on the image column. The storage works fine, I have no problems when uploading images directly from the site. I really don't know what I'm missing here, given that not a single error occurs and the seeding proceeds just fine.
Sadly the url the $faker->image is using is down, so it won't work - the URL that's using is http://lorempixel.com
You can always import fake images to your storage and then randomly apply them - that's what I do.
Please or to participate in this conversation.