I need help to solve this error Exception Serialization of 'Illuminate\Http\UploadedFile' is not allowed
I am using events and listeners.
I wanna save a title, description and a photo. I think , the problem is the photo!
public function storePublication($request){
event(new PublicationEvent($request->all()));
}
class PublicationEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $publication;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($publication)
{
$this->publication = $publication;
}
class SendAutoResponder implements ShouldQueue
{
/**
* Handle the event.
*
* @param PublicationEvent $event
* @return void
*/
public function handle(PublicationEvent $event)
{
dd($event);
}
You can’t pass an uploaded file instance to a job (event). You need to write it to disk somewhere, and then retrieve it when handling the job (event). Check Serialization of 'Illuminate\Http\UploadedFile' is not allowed On queue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With