I'm using beanstalkd with Laravel to queue some tasks but I'm having trouble to send data to the function that handles the queue , Here is my code
//Where I call the function
$object_st = new stdClass();
$object_st->Person_id = 2 ;
//If I do this: echo($object_st->Person_id); , I get 2
Queue::push('My_Queue_Class@My_Queue_Function', $object_st );
And the function that handle the queue is the following
public function My_Queue_Function( $Data )
{
$Person_id = $Data->Person_id; //This generate the error
//Other code
}
The error says:
[ErrorException]
Undefined property: Illuminate\Queue\Jobs\BeanstalkdJob::$Person_id