Php Laravel 5.2-带有迁移表名命令的Laravel模型
我有两个命令来进行迁移和建模 如果我跑-Php Laravel 5.2-带有迁移表名命令的Laravel模型,php,laravel,laravel-5,laravel-5.1,laravel-5.2,Php,Laravel,Laravel 5,Laravel 5.1,Laravel 5.2,我有两个命令来进行迁移和建模 如果我跑- php artisan make:migration create_users_table --create=temps 然后我得到了这样一个迁移-2016\u 02\u 09\u 060158\u create\u users\u table.php <?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; cl
php artisan make:migration create_users_table --create=temps
然后我得到了这样一个迁移-2016\u 02\u 09\u 060158\u create\u users\u table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTempsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('temps', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('temps');
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Temp extends Model
{
//
}
此文件中的内容是-
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('temps', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('temps');
}
}
然后我得到这2个文件-
2016\u 02\u 09\u 060436\u create\u temps\u table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTempsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('temps', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('temps');
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Temp extends Model
{
//
}
找到了这个-
我真的不理解您的问题,但我认为您需要一个同时生成模型和迁移的命令 您应该查看软件包。您可以执行以下操作:
php artisan make:migration:schema create_dogs_table --schema="name:string"
要解决这个问题,任何人都应该安装视频中显示的依赖项