for the attachment_type field in the system_files table, a string with the class name is automatically generated. How to set specify class string?
looks like this now:
public $attachOne = [
'main_photo' => [
'System\Models\File',
'delete' => true,
]
];
I'm assuming here, but I guess you're not wanting to have the full class stored in in the
attachment_typecolumn of thesystem_filestable.What you can do is define a morph map in the
boot()method of your plugin'sPlugin.phpfile.So if you had a plugin in the
October\Shopnamespace, with aProductmodel you could do this.You can read about this in the docs.
OctoberCMS Version 2 docs: Custom Polymorphic Types
OctoberCMS Version 3 docs: Custom Polymorphic Types