未定义类型 - laravel 项目

问题描述 投票:0回答:1

我对 Laravel 项目有疑问,这是我从克隆 github 得到的。

<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->foreignId('id_level_user')->nullable()->index('fk_users_to_level_users');
            $table->string('profile_photo_path', 2048)->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

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

问题是我无法使用这些方法:

enter image description here

我尝试过迁移、种子以及有关数据库的所有内容,但仍然不起作用

laravel migration undefined laravel-livewire
1个回答
0
投票

您需要重新索引工作区。 如果你使用 vsCode... 按 ctrl + shift + p,然后按索引工作空间

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.