1 year ago

get all the other id in find()

Posted 1 year ago by haizone

i have a function that i get all the records from the db i have in the db the ids: 1,2,3,4,5


and i get in collection all of that id's - and its great!

but now i whant to get all the other id's (didnt inside the find() but thay in the relationships in this case the id's: 4,5 (in a collection - i need to get back)

i need to use a foreach or in laravel have a faster why to do that?

Please sign in or create an account to participate in this conversation.