Skip to content

Two Errors running your multiresource yaml example #30

@ja-tomasz

Description

@ja-tomasz

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions