Базовая таблица или вид не найден

Для этой проблемы выполните следующие шаги:

  1. Остановить все ENV
  2. Удалить карты, созданные с помощью команды (удаление карты композитора)
  3. Запустите ENV снова
1
задан Umar Abdullah 19 January 2019 в 18:18
поделиться

1 ответ

В PostUsers Модель определяет имя таблицы

class PostUsers extends Model {
    public $table = "post_users";

Обновление:

Не должно

Schema::table('post_users', function (Blueprint $table) {
    $table->integer('post_id')->unsigned();
    $table->integer('user_id');
    $table->foreign('post_id')
        ->references('id')->on('posts')
        ->onDelete('cascade')->unsigned()->index();
});

быть

Schema::create('post_users', function (Blueprint $table) {
    $table->integer('post_id')->unsigned();
    $table->integer('user_id');
    $table->foreign('post_id')
        ->references('id')->on('posts')
        ->onDelete('cascade')->unsigned()->index();
});

Если вы собираетесь создать новую таблицу, вы должны использовать Schema::create

0
ответ дан Iftikhar uddin 19 January 2019 в 18:18
поделиться
Другие вопросы по тегам:

Похожие вопросы: