run jobs laravel
php artisan queue:work --queue=high,default
run jobs laravel
php artisan queue:work --queue=high,default
laravel jobs tutorial
class CreateJobsTable extends Migration{
// this method will create a database called jobs with its respective columns
public function up(){
Schema::create('jobs', function (Blueprint $table) { //we define our database columns here
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
// this method is used to check if the table already exists
public function down(){
Schema::dropIfExists('jobs');
}
}
laravel jobs tutorial
Route::get('sending-queue-emails', [TestQueueEmails::class,'sendTestEmails']);
laravel jobs tutorial
class TestQueueEmails extends Controller
{
/**
* test email queues
**/
public function sendTestEmails()
{
$emailJobs = new TestSendEmail();
$this->dispatch($emailJobs);
}
}
jobs laravel
$user->notify((new InvoicePaid($invoice))->delay([
'mail' => now()->addMinutes(5),
'sms' => now()->addMinutes(10),
]));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us