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

Pivot / Relationship #2

Open
phillipmadsen opened this issue May 3, 2017 · 6 comments
Open

Pivot / Relationship #2

phillipmadsen opened this issue May 3, 2017 · 6 comments

Comments

@phillipmadsen
Copy link

I see the stub for pivot table but how do i generate one and tie them together in the generate command?

@rolandalla
Copy link
Owner

Hello @phillipmadsen You can use this command php artisan make:migration:pivot tags posts
This will atumatically create pivot table for DB tags and Posts. Thanks

@phillipmadsen
Copy link
Author

@roladn

  1. Just to clarify I create one crud say posts
  2. then I separately create another for tags
  3. once they are created I then run the command above to create the pivot?

Are the existing cruds updated to use the pivot table with the proper relationships or do we have to manually go and add them?

@rolandalla
Copy link
Owner

rolandalla commented May 4, 2017 via email

@marcol417
Copy link

please how about one to many relationships ? how do we generate it please ?

@rolandalla
Copy link
Owner

@marcol417
Please check the Laravel Documentation 👍
https://laravel.com/docs/5.5/eloquent-relationships#one-to-many

Regards

@marcol417
Copy link

marcol417 commented Feb 16, 2018 via email

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