I hope I described the subject properly. I'm creating a contact management application where each user will have his own contacts within the same contact table. Users must not be able to see each other's contacts.
I started by doing this but there must be a better way:
$contact = Contact::where('user_id', Auth::user()->id)->find($id);
The problem with the line above is that I would like to write it this way:
$contact = Contact::find($id)
Is there a way to have the where clause loaded somehow like filters maybe so that all searches have to match the Auth::user()->id
?