jim1506's avatar

Backpack for Laravel - several different image uploads in CRUD form

I have a countries table with 3 fields to store image names:

  1. flag
  2. capitalPhoto
  3. banner
  4. map

In my CRUD form I have the 4 upload fields defined and initially has two mutators for flag and capitalPhoto with no problems by defining two functions:

public function setflagAttribute($value) {...}
public function setcapitalPhotoAttribute($value) {...}

when I try to add the last 2 it fails as it tries to store the data in the database as opposed to uploading it.

I have tried to see if there is part of the image field type which enables me to say which mutator to use.

Anyone else come across this and solved it?

Thanks!

0 likes
0 replies

Please or to participate in this conversation.