I'm seeding a [skills] table but I'm getting an error in the console and it's so vague. If you check, nothing useful really. Just an exception.
The data that I'm trying to seed are string
and images
so naturally, the column that accepts the image
is a BLOB.
MySQL Workbench:
Strangely, as you can see some seed data went through (HTML & CSS). These image files are stored in storage /storage/app/images/skills/MY_IMAGE_FILE.png
.
I made sure that it isn't a typo in the PATH so something must be wrong with the file but this javascript /storage/app/images/skills/javascript_logo.jpg
, the 3rd on the array is where the seeding throws an exception.
This is the array that I'm trying to seed. As you can see, the 3rd item on the array fails.
SkillsSeeder.php*
To test if the 3rd file is corrupt. I tried running the file directly in my view file.
<img src="data:image/png;base64, {{ base64_encode(file_get_contents(storage_path('app/images/skills/javascript_logo.jpg'))) }}" />
but it displays properly on the browser. So it must the format. I tried to change it to .png
. Still getting Seeding error but if displayed directly on view, it works.
At this point, I am sure that:
- The image file is ok.
- The path to storage is ok.
- File format is NOT the issue.
My guesses:
- Something wrong with the seeder but how come, I had another table with the same columns (varchar & BLOB) in terms of data type and seeder class that uses the exact same methods but that doesn't fail. That and this seeder is almost identical.
Sorry for packing tons of images but this last image is just the Seeder.
I'm really confused as to why the 3rd seed fails. Just the 3rd.