Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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');
    }
}
like image 844
Ion Mîndru Avatar asked Apr 16 '19 13:04

Ion Mîndru


1 Answers

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

like image 118
moathdev Avatar answered Nov 05 '22 22:11

moathdev