rtconner / laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a "like" or "favorite" or "remember" feature.
MIT License
401 stars 49 forks source link

Undefined function. #24

Closed catoruno closed 8 years ago

catoruno commented 8 years ago

I am using Laravel 5.2 and i can set up likeable. In my model

use Conner\Likeable\LikeableTrait;

class Dish extends Model { use LikeableTrait; }

When i call $favorites = Dish::whereLiked($id)->with('likeCounter')->get();

I have this error

SQLSTATE[42883]: Undefined function: 7 ERROR: el operador no existe: character varying = integer LINE 1: ...keable_likes" where "likeable_likes"."likable_id" = "dishes"... ^ HINT: Ningún operador coincide con el nombre y el tipo de los argumentos. Puede ser necesario agregar conversiones explícitas de tipos. (SQL: select * from "dishes" where exists (select * from "likeable_likes" where "likeable_likes"."likable_id" = "dishes"."id" and "likeable_likes"."likable_type" = App\Dish and "user_id" = 2))

Any idea?

Thank's Carlos

rtconner commented 8 years ago

It's ->whereLikedBy(). I've updated the documentation.