0

I have this issue:

If I use relation with model Fotos in Model Order - I can't output image from relation model. (I.e. I tried using fotos.image in field text, field upload but image not indicated). I can't use Backpack Pro - but only base fields.

My Model Order:

     public function fotos()
        {
            return $this->HasMany(Foto::class, 'orderid')->select('image');
        }

Crud:

     $this->crud->addField([
         'name' => 'fotos.image',
         'label' => 'Image',   
         'type' => 'upload',
       ])

I have this string in output:

[{"image":"\/upload\/userfiles\/orders_images\/2025\/10\/19_457387090.png"}]

How I can receive only link to image? Thank you!

1 Answer 1

0

I have't solution for my issue. But I does custom field and changed my update form with tis way. Why Backpack have't simply solutions for relations? All Laravel bulds with relations. Very strange situation!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.