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

Plural form of Child becomes Childrens #3

Closed
activemonkeys opened this issue Oct 23, 2016 · 1 comment
Closed

Plural form of Child becomes Childrens #3

activemonkeys opened this issue Oct 23, 2016 · 1 comment

Comments

@activemonkeys
Copy link

Just came across a minor thing...

In my project there is a table called "children". In the schema, the following foreign key is created:

$table->foreign('individual_id')->references('id')->on('individuals')->onDelete('cascade');

The "child" model is created correctly with your script. However, in the "individual" model the following function is created:

public function childrens()
{
    return $this->hasMany(\App\Models\Child::class);
}

Have manually renamed "childrens" to "children" so no problem.

@CristianLlanos
Copy link
Member

CristianLlanos commented Oct 23, 2016

It seems the library I used to pluralize table names adds an 's' to the plural form of children (of course it does not have a plural form). I thought It was smart enough as not to add an 's'. I've made a quick fix for this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants