Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown column 'reacted_by' in 'where clause' #254

Closed
salvatormundiz opened this issue Oct 19, 2023 · 4 comments
Closed

Unknown column 'reacted_by' in 'where clause' #254

salvatormundiz opened this issue Oct 19, 2023 · 4 comments

Comments

@salvatormundiz
Copy link

I working with V9 laravel-love!
my User model use as Reacterable and Reactable!
when I use this line:

$user=User::find(6);
        $myTherapist = User::query()
            ->whereReactedBy($user)
            ->get();
        dd($myTherapist);

my response is:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reacted_by' in 'where clause'
@antonkomarev
Copy link
Member

@salvatormundiz did you added Reactable trait to User model?

https://laravel-love.readme.io/docs/setup-reactable

@salvatormundiz
Copy link
Author

It is my User model I want user can bookmark other user so use both:

use Cog\Contracts\Love\Reacterable\Models\Reacterable as ReacterableInterface;
use Cog\Laravel\Love\Reacterable\Models\Traits\Reacterable;
use Cog\Contracts\Love\Reactable\Models\Reactable as ReactableInterface;
use Cog\Laravel\Love\Reactable\Models\Traits\Reactable;
class User extends Authenticatable implements ReacterableInterface,ReactableInterface
{
    use HasApiTokens, HasFactory, Notifiable,HasRoles,Reacterable,Reactable;
    ```

@antonkomarev
Copy link
Member

@salvatormundiz I forgot to add to the documentation query scopes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants