0

I'm tryin to add fileUpload to my multisite plugin ,while adding a new domain i want to upload the country flag of that website. I trie some things but this error showed up while trying to adisplay the crating new domain form. error:

Model'Keios\Multisite\Models\Setting' does not contain a definition for 'image' october cms

i created an other plugin kin which i add the changes i want to create in multisite plugin

MultisiteModel::extend(function (MultisiteModel $model){

            $model->attachOne=[
                'flag' => 'System\Models\File'
            ];
        });
Rajan Sharma
  • 2,211
  • 3
  • 21
  • 33
Islam
  • 9
  • 7

1 Answers1

0

in your model file of your plugin add this :

image should be the name of your field !

public $attachOne = [
    'image' => 'System\Models\File'
];

and then you can call it $model->image for more information look at the doc https://octobercms.com/docs/database/attachments#file-attachments

Noureddine
  • 31
  • 2
  • 7