Search
 
SCRIPT & CODE EXAMPLE
 

PHP

dispatch job with queue name in laravel

// You can disaptch a job with queue name as following
dispatch(new YourJob())->onQueue('my_queue');

// to make it work
php artisan queue:work --queue=my_queue
Comment

laravel queues job payload data

Queue::before(function (JobProcessing $event) {
    $jsonpayload = $event->job->payload();

    if ($jsonpayload['data']['commandName'] === 'AppJobsSendAlert') {
        $data = unserialize($jsonpayload['data']['command']);
        $user = DB::table('users')->where('id','=',$data->test->user_id)->first();
        $pay = DB::table('donates')->where('user_id','=',$user->id)->where('status','=','0')->first();
        if(!is_null($pay)) {
            $event->job->release(Carbon::now()->addSeconds(60));
        }
    }
});
Comment

queue jobs in laravel

ProcessPodcast::dispatch($podcast)->beforeCommit();
Comment

PREVIOUS NEXT
Code Example
Php :: laravel request has 
Php :: php undefined index meaNING 
Php :: laravel Auth::logoutOtherDevices 
Php :: php file upload 
Php :: if exists in string count php 
Php :: custom timestamp column laravel 
Php :: laravel validation numeric vs integer 
Php :: yajra laravel datatables rawcolumn 
Php :: codeigniter session destroy automatically after redirect 
Php :: how to check path laravel 
Php :: echo string in php 
Php :: start php cli 
Php :: laravel hash namespace 
Php :: livewire call another component 
Php :: laravel simplexmlelement not found 
Php :: php url variables 
Php :: withsuccess laravel 8 
Php :: laravel exclude field 
Php :: how to use custome functions in laravel 
Php :: display pdf file in laravel 
Php :: php query to hide duplicate records 
Php :: laravel santum 
Php :: validate either one field is required in laravel 
Php :: laravel route multiple middleware 
Php :: php injection 
Php :: keep line breaks in textarea 
Php :: bind to class blade laravel 
Php :: laravel collection first 
Php :: session_regenerate_id 
Php :: firstOrFail() 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =