lunarphp / lunar

An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Home Page:https://lunarphp.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TranslateText richTextOption didn't the attach the uploaded images

bangnokia opened this issue · comments

  • Lunar version: 1.x
  • Laravel Version: 10.48.2
  • PHP Version: 8.3.0
  • Database Driver & Version: MySQL 8

Expected Behaviour:

The Image should be inserted in the content of the data

Actual Behaviour:

The images not inserted to the content

Steps To Reproduce:

This also happens when editing the Product description also, so we don't have to creat a custom resource like me xD

For example, we have the Post model, which has column content as json
Use the trait HasTranslations to the Post model.
In the resource form method

 public static function form(Form $form): Form
    {
        return $form
            ->columns(1)
            ->schema([
                TranslatedText::make('content')->label('Content')->optionRichtext(true)->nullable(),
            ]);
    }

we upload the image to the content, it is displayed in the RichEditor
click save -> notification success
But after reloading, the image disappears.
I'm checking in the database, there is also no image here