Jeffrey方式生成器错误输出到迁移

时间:2014-12-18 09:06:22

标签: laravel-4 migration

我正在使用jefrey方式生成器来创建我的迁移,而不是相应地生成输出这是我的迁移

php artisan generate:migration create_employees_table --fields="first_name:string,
last_name:string,gender:string,phone:integer,address:string,photo:string,age:integer,
salary:integer"

创建的迁移如下

class CreateEmployeesTable extends Migration {

/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('employees', function(Blueprint $table)
    {
        $table->increments('id');
        $table->string('first_name');
        $table->string,gender('last_name')->string,phone()->integer,address()->string,photo()->string,age()->integer,salary()->integer();
        $table->timestamps();
    });
}


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

我的问题是我在生成器命令中做错了它没有正确输出迁移,也澄清我在windows上使用git shell

1 个答案:

答案 0 :(得分:1)

以逗号后的空格

  php artisan generate:migration create_employees_table --fields="first_name:string, last_name:string, gender:string, phone:integer, address:string, photo:string, age:integer, salary:integer"