Thursday, January 13, 2022

[FIXED] how to fix "Method Illuminate\Database\Schema\Blueprint::class does not exist."

Issue

When I use php artisan migrate I receive this message. Can someone help me with this? I searched on the Internet but I didn't find anything that helped me. (I am new in laravel)

my table:

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

Solution

$table->class('class'); // class not type .



Answered By - moathdev

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.