“Tutorial de empregos de Laravel” Respostas de código

criando empregos Laravel

QUEUE_CONNECTION=database
John Maingi

Tutorial de empregos de Laravel

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');
    }
}
Precious Peacock

Tutorial de empregos de Laravel

class TestQueueEmails extends Controller
{
    /**
    * test email queues
    **/
    public function sendTestEmails()
    {
        $emailJobs = new TestSendEmail();
        $this->dispatch($emailJobs);
    }
}
Precious Peacock

Tutorial de empregos de Laravel

Route::get('sending-queue-emails', [TestQueueEmails::class,'sendTestEmails']);
Precious Peacock

Respostas semelhantes a “Tutorial de empregos de Laravel”

Perguntas semelhantes a “Tutorial de empregos de Laravel”

Mais respostas relacionadas para “Tutorial de empregos de Laravel” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código