get all the other id in find()

Posted 11 months 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

$businessproduct->branches()->find([1,2,3]);

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.

Reply to

Use Markdown with GitHub-flavored code blocks.