I am using laravel-comment to enable Users to comment on each other. Therefor, I need to use both the Commentable and the CanComment trait. But when I use them together, I get an error.
User uses it like this:
use Commentable, CanComment {
Commentable::comments insteadof CanComment;
}
And I am trying to seed the comments like this:
foreach (User::all() as $user) {
$receiver = User::where('id', '!=', $user->id)->inRandomOrder()->get();
$user->comment($receiver, $faker->text(100), 3);
}
Even though the CanComment trait has a method called getCanBeRated
, I get an error saying that it doesn't. Why is this happening?