Depending on your overall architecture you could define a scope for the current user:
public function scopeCurrentUser($query)
{
return $query->where('user_id', Auth::user()->id);
}
You can then apply the scope like this:
public function find($id)
{
return Note::currentUser()->find($id);
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community