gpt4 book ai didi

laravel - 命令 "queue:failed-table"未定义

转载 作者:行者123 更新时间:2023-12-05 00:55:18 25 4
gpt4 key购买 nike

出于某种原因,我无法在 Lumen 5.2 中生成失败的作业表。

我咨询过:

The Lumen 5.2 Docs

The Lumen 5.1 Docs

The Laravel 5.2 Docs

而唯一提到的生成器 artisan queue:failed-table简单地返回:

[Symfony\Component\Console\Exception\CommandNotFoundException]  
Command "queue:failed-table" is not defined.
Did you mean one of these?
queue:failed
queue:forget
queue:flush
queue:retry
queue:work
queue:listen
queue:restart

有谁知道为什么会这样?由于(好吧,错误)并且没有要处理的失败作业表,应用程序本身正在抛出错误。

多谢!

最佳答案

我相信 CmdrSharp 是正确的,Lumen 不包括 artisan queue:failed-table命令。

如果有帮助,以下是我自己创建 failed_jobs 表的步骤:

1) 创建迁移以创建 failed_jobs 表。生成的迁移将放置在/database/migrations 文件夹中。

php artisan make:migration create_failed_jobs_table --table=failed_jobs

2) 编辑迁移,使其看起来像这样:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->increments('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->timestamp('failed_at')->useCurrent();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('failed_jobs');
}
}

3) 运行迁移以创建表
php artisan migrate

祝你好运!

关于laravel - 命令 "queue:failed-table"未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38258542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com