2016-11-24 94 views
0

看看這個圖片:https://postimg.org/image/4fvu34juz/爲什麼php artisan遷移失敗:未定義的方法?

當我運行PHP的工匠遷移,有顯示:

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

解決我的問題的任何解決方案?

更新:

代碼:

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

請顯示移植。 –

+0

@Alexey Mezenin,我更新了我的問題 –

+1

錯誤表示您嘗試在某處使用'textarea',因此您應該找到此遷移並將其顯示給我們。 –

回答

1

這意味着沒有在Blueprint類名爲textarea()功能。刪除調用它的代碼。

+0

我遵循這裏:https://laravel.com/docs/5.3/migrations –

+2

你的遷移看起來不錯,也許你的代碼(另一個遷移腳本?)調用了textarea()。也許你需要的是'text()'方法。 –

+0

解決。我找到了。謝謝 –