我正在使用Laravel 5.4和生成遷移的程序包migrations-generator。如何在Laravel中生成遷移視圖?
所以我有了遷移,現在我需要使用Artisan自動生成視圖。我在Symfony上嘗試過,這很容易,但我不能用Laravel來做。
以下是一個遷移文件示例,名爲2017_07_01_202030_create_personas_table.php適用於人員。
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePersonasTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personas', function(Blueprint $table)
{
$table->integer('id', true);
$table->string('nombre', 100);
$table->dateTime('fecha_de_nacimiento');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('personas');
}
}
我試圖超過八個包,以解決我的問題:生成模式,從一個表(上Laravel 5.4)的意見和控制器,但他們沒有工作。否則,我將使用非常棒的Yii框架。
我試過了,但沒有使用遷移。我需要使用遷移來生成模型,視圖和控制器。我的數據庫的數據只在migrations文件夾中。 –