'Images don't save using Faker Image in seeder
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|