简体   繁体   中英

laravel - limit a relation to a certain number

i am now starting laravel at school and my teacher ask for this: three tables, countries, users and bicycles. I have to use factories to make both users and bicycles. each user must two bicycles associated. how do I do that? till today I only did has one or many relations and I don't know how to limit this to a specific number like he asked. hope somebody can help, thanks

i am now starting laravel at school and my teacher ask for this: three tables, countries, users and bicycles. I have to use factories to make both users and bicycles. each user must two bicycles associated. how do I do that? till today I only did has one or many relations and I don't know how to limit this to a specific number like he asked. hope somebody can help, thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM