Métodos Frequentes
Métodos Frequentes
Métodos Frequentes
Métodos Frequentes
public function isLiked($user_id) { $picture = $this; return Picture::whereHas('likes', function ($q) use($picture, $user_id) { $q->whereRaw('user_id = ? and picture_id = ?', array($user_id, $picture->id)); })->exists(); }