Image path is not saving in table column
Section::make("Images")
->collapsible()
->schema([
Repeater::make('images')
->relationship('images')
->schema([
TextInput::make('size')
->required(),
SpatieMediaLibraryFileUpload::make('image_url')
->disk('r2')
->directory('product_images')
->collection('product_images')
->image()
->required(),
])
->addActionLabel('Add Image')
->defaultItems(3)
])
when try to save changes, image is uploading to cloudflare but path is not update rather i get error message
SQLSTATE[HY000]: General error: 1364 Field 'image_url' doesn't have a default value (Connection: mysql, SQL: insert into
SQLSTATE[HY000]: General error: 1364 Field 'image_url' doesn't have a default value (Connection: mysql, SQL: insert into
product_images
(size
, product_id
, updated_at
, created_at
) values (111, 1, 2024-10-01 18:50:33, 2024-10-01 18:50:33))7 Replies
can some one please help me on this ⤴️
@Dennis Koch
kalesha_ has been warned, this is their first warning.
is Image_url in the $fillable array of the Model?
yes.
maybe its a conflict with spatieimage plugin, can you try with the default fileupload?
with default fileupload image was updating in db but while retrieving image from db column wasn't working.
thats why i had to shift to spatie media library.
i tried many solutions from stackoverflow, laravel sites but none of them worked and its frustrating .... 🥹
with fileupload, if i have to show the image from signed url how can we achieve this ??
Sadly I can't help you with that because I don't know