Search code examples
phplaravelcommand-linecommand-promptlaravel-5.3

Why php artisan migrate fails: undefined method?


Look this image : https://postimg.org/image/4fvu34juz/

When I run php artisan migrate, there is display :

[symfony\component\debug\exception\fatalthrowableerror]
call to undefined method illuminate\database\schema\blueprint::textarea<>

Any solution to solve my problem?

Update :

Code :

<?php

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

class CreateFlightTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('flights', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('airline');
            $table->timestamps();
        });
    }

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

Solution

  • It means there is no function named textarea() in class Blueprint. Remove code that call it.