samedi 31 octobre 2015

How do I get the name of a Job in larval 5

I've tried $this->getName() inside the laravel Job

This is my sample job class

class PrepareCustomersSearchExportJob extends Job implements SelfHandling, ShouldQueue
    {
    use InteractsWithQueue, SerializesModels;

    private $path;
    private $filename;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($path, $filename)
    {
        $this->path = $path;
        $this->filename = $filename;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
             echo  “Name  = “. $this->getName();    
    }
}

But the method above tells me getName() isn't defined.

Thanks for your help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire