Working on a project in Backpack for Laravel that involves uploading images, videos, etc. Starting with a simple image upload, I have a mutator in my model as follows:
public function setThumbnailAttribute($value)
{
$attribute_name = "Thumbnail_URL";
$disk = "s3";
$destination_path = "images";
$this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);
}
But it doesn't seem to fire, and whenever the file is 'uploaded' it shows a 'C:\Windows\Temp\php6803.tmp' as the location.
My field:
$this->crud->addField([
'name' => 'Thumbnail',
'label' => 'Thumbnail',
'type' => 'image',
'upload' => true,
'disk' => 's3'
]);
And my 's3' disk in filesystems.php:
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
],
I've double checked that the Thumbnail_URL is fillable. I'm really not sure what I'm missing.