简体   繁体   English

laravel - 将关系限制为某个数字

[英]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.我现在在学校开始 laravel,我的老师要求这个:三张桌子,国家,用户和自行车。 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.我现在在学校开始 laravel,我的老师要求这个:三张桌子,国家,用户和自行车。 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希望有人可以帮忙,谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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