The error refers to, if I'm not mistaken, to the column main_image not existing on your database table.
Mar 24, 2020
2
Level 12
Change request via trait in model
Hi. I i build an extension to upload images, to use it in different other extensions. I think about using a trait which uses the boot methods to do all upload stuff and then replace the request. This is the problem... how can i replace the request. In my example i have an image called "main_image" and want to do something like that:
trait UploadTrait {
public static function bootUploadTrait()
{
static::updating(function ($model) {
request()->replace(request()->except('main_image'));
});
Is that possible? Because i still get my error: Column not found: 1054 Unknown column 'main_image' in 'field list'
Hope someone can help me or have another idea.
thx Norman
Level 9
Please or to participate in this conversation.