2017-06-26 18 views
0

私が必要とするのは、以前のプロジェクトで使用していた古いデータベースに新しいプロジェクトを接続することでした。それは必須です。私はLaravel Php artisan migrateエラー

class attendance extends Model 
{ 
    protected $table = "attendance"; 
    protected $fillable = ['id', 

    'trainee_id', 
    'name', 
    'time' 
    ]; 
} 

attendance.phpデータモデル

を作成しているように、その後の移行は、ここにcreate_attendance_table

Schema::create('attendance', function (Blueprint $table) { 
      $table->increments('id'); 
      $table->string('trainee_id'); 
      $table->strind('name'); 
      $table->string('time'); 
      $table->rememberToken(); 
      $table->timestamps(); 
     }); 

だけでなくとも呼ば.env

APP_NAME=Laravel 
APP_ENV=local 
APP_KEY=base64:aMklPOtN0cQEm2OiaeFpBaw75ghPLTxvj8Yx7PrQ8Gc= 
APP_DEBUG=true 
APP_LOG_LEVEL=debug 
APP_URL=http://localhost 

DB_CONNECTION=mysql 
DB_HOST=127.0.0.1 
DB_PORT=3306 
DB_DATABASE=Training_Management 
DB_USERNAME=root 
DB_PASSWORD= 

BROADCAST_DRIVER=log 
CACHE_DRIVER=file 
SESSION_DRIVER=file 
QUEUE_DRIVER=sync 

REDIS_HOST=127.0.0.1 
REDIS_PASSWORD=null 
REDIS_PORT=6379 

MAIL_DRIVER=smtp 
MAIL_HOST=smtp.mailtrap.io 
MAIL_PORT=2525 
MAIL_USERNAME=null 
MAIL_PASSWORD=null 
MAIL_ENCRYPTION=null 

PUSHER_APP_ID= 
PUSHER_APP_KEY= 
PUSHER_APP_SECRET= 
です

これは私が得ているエラーです。あなた移行ファイルのcreate_attendance_tableで

enter image description here

+0

 $table->strind('name'); 

答えて

4

を変更する必要があります。だから、

、あなたはあなたの問題を解決した場合は$table->string('name');

+0

を閉じてください変更は、非常に多くのuをありがとう – Dasun

1

あなたが移行ファイルに構文エラーがあり

$table->strind('name');

$table->string('name');

0

 $table->string('name'); 

に変更 $table->strind('name');、その後、質問
関連する問題