Level 27
What are you trying to do here 'file' => upload('Properties', $image)?
Error Serialization of 'Illuminate\Http\UploadedFile' is not allowed
################################ Contaroller : dispatch(new UploadImages($data->images,$property_id));
########################### class UploadImages implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $data;
public $property_id;
public function __construct($data,$property_id)
{
$this->data = $data;
$this->property_id = $property_id;
}
public function handle()
{
logger($this->data);
foreach ($this->data as $image) {
DB::table('medias')->insert(
[
'file' => upload('Properties', $image),
'mediable_id' => $this->property_id,
'mediable_type' => 'App\Models\Property'
]
);
}
}
Please or to participate in this conversation.