Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two Errors running your multiresource yaml example #30

Closed
ja-tomasz opened this issue Feb 3, 2017 · 2 comments
Closed

Two Errors running your multiresource yaml example #30

ja-tomasz opened this issue Feb 3, 2017 · 2 comments

Comments

@ja-tomasz
Copy link

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)

@StephaneBour
Copy link
Contributor

Hi,

I have fix this on cc39d72 (replace space by comma on rules).

For the belongTo duplicate, you just need to remove your field in fields:

@webNeat
Copy link
Owner

webNeat commented May 8, 2017

This was fixed by @StephaneBour

@hittg Fell free to reopen this if the issue is still occuring.

@webNeat webNeat closed this as completed May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants