首页 > 解决方案 > 如何修复“方法 Illuminate\Database\Schema\Blueprint::class 不存在。”

问题描述

当我使用 php artisan migrate 时,我会收到此消息。有人可以帮我弄这个吗?我在互联网上搜索,但没有找到任何对我有帮助的东西。(我是laravel的新手)

我的桌子:

<?php

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

class CreateServiceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('service', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('description');
            $table->string('icon');
            $table->class('class');
            $table->timestamps();
        });
    }

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

标签: laravelmigration

解决方案


$table-> class ('class'); // 类不是类型。


推荐阅读