laravel-async-queue icon indicating copy to clipboard operation
laravel-async-queue copied to clipboard

getting "Class does not exist" error

Open sudipta26889 opened this issue 9 years ago • 0 comments

First of all i like to thank you for this awesome plugin. I have created a job class called UploadToDropbox and the class is as follows

<?php
namespace App\Jobs;
use App\User;
use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
use League\Flysystem\Dropbox\DropboxAdapter;
use League\Flysystem\Filesystem;
use Dropbox\Client;
use Image;

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

    protected $file;
    protected $user;
    protected $mainFolderName;
    protected $subFolderName;
    protected $filename;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($file, User $user, $mainFolderName, $subFolderName, $filename='file')
    {

        $this->file = $file;
        $this->user = $user;
        $this->mainFolderName = $mainFolderName;
        $this->subFolderName = $subFolderName;
        $this->filename = $filename;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {

        $this->uploadToDropbox1($this->file, $this->user, $this->mainFolderName, $this->subFolderName, $this->filename);  
    }

    private function uploadToDropbox1($file=null, $user=null, $mainFolderName=null, $subFolderName=null, $filename='file') {
        dd('called');
    }
}

And i am trying to dispatch the job from controller, and the code is as follows

$job = new UploadToDropbox($filecontents, $user, $mainFolderName, $subFolderName, $filename);
$this->dispatch($job);

But i don't know why everytime i am getting "Class (blank) does not exist". Please have a look at the attached image

screenshot from 2015-10-16 22 09 02

Please help me to resolve this. Thank you.

sudipta26889 avatar Oct 16 '15 16:10 sudipta26889