【发布时间】:2016-02-01 13:48:41
【问题描述】:
我正在使用 Laravel 5.1.11,但是当我尝试运行 php artisan migrate 命令时,我遇到了以下错误消息:
****[symfony\Component\Debug\Exception\FatalErrorException] syntax Error, unexpected 'public' (T_PUBLIC)****
在database.php 和.env 中使用数据库连接配置非常好,因为php artisan migrate:install 工作正常。
这是迁移代码:
**<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFlightsTables extends Migration
{
/**
* Run the migrations.
*
//
Schema::create('flights', function (Blueprint $table) {
* @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');
}
}**
【问题讨论】:
-
你能发布一些你的迁移源和迁移中使用的代码吗?该错误看起来像是您的一个文件中存在语法错误,它可能不是迁移。
-
在此处粘贴您的迁移代码,以便我们查找错误。
-
注意下面的迁移文件:
-
请将问题标记为已回答
标签: laravel-5.1 database-migration