Skip to content

Tag: eloquent

Laravel | How to use Pivot table with Relationship

I have a question about the relationship. I have an activity model and controller. I guess I searched a lot, I find an attached method for this. But idk how to use it. I have an activity table like this: And another table is activity_asset like this: Now I don’t know how to relate these two tables. What…

Laravel destroy nested resource

I have a resource name OrganizationEmailDomain and able to index it just fine In that view, when clicking in the three dots there’s the destroy part If in that index view I echo $email_domains (<?php echo $email_domains;?>) then I get as expected (note that the following was before the images were…

Laravel get union between two objects

I have the following to get all organizations the logged in user owns and to get all organizations the logged in user is member of Given that I want an object with the union of both, I tested to run then I only get one organization If I run then I got While the result is correct in the sense