-
Notifications
You must be signed in to change notification settings - Fork 93
Description
1st problem is with the "store_id" field definition:
[Wn\Generators\Exceptions\ArgumentParserException]
Required field missing: 3 given (store_id;integer:nullable;required) but 4
required (name;schema;rules;tags)
when I remove the "rules: required numeric" from "store_id" it works fine, but:
2nd the definition of the field which has already been indirectly defined by relation "belongsTo: gives the duplicate field definition in the migration and the model:
public function up()
{
Schema::create('products', function(Blueprint $table) {
$table->increments('id');
$table->integer('store_id')->nullable();
$table->text('desc')->nullable();
$table->date('published_at');
$table->decimal('price', 5, 2);
$table->integer('store_id')->unsigned();
$table->foreign('store_id')
->references('id')
->on('stores');
$table->timestamps();
$table->softDeletes();
});
}
the correct result should be:
$table->integer('store_id')->unsigned()->nullable();
...as it should be possible to define additional properties of the field being used as a FK (like making it nullable for instance)