laravelista / comments

Native comments for your Laravel application.
MIT License
744 stars 142 forks source link

Argument Two passed #172

Closed aafaq146 closed 2 years ago

aafaq146 commented 2 years ago

![Uploading image.png…]() what's the error about??

mabasic commented 2 years ago

I can't see the image.

aafaq146 commented 2 years ago

TypeError Argument 2 passed to Laravelista\Comments\CommentPolicy::reply() must be an instance of Laravelista\Comments\Comment, instance of App\Comment given, called in C:\Users\AaFaQ Ahmad\Desktop\SMDP\vendor\laravel\framework\src\Illuminate\Auth\Access\Gate.php on line 204 (View: C:\Users\AaFaQ Ahmad\Desktop\SMDP\resources\views\vendor\comments_comment.blade.php)

aafaq146 commented 2 years ago

this is the error?

mabasic commented 2 years ago

You are passing an instance of App/Comment instead of Laravelista/Comments/Comment. It says so in the error message.

I don't know what you are trying to do, but follow the readme instructions and you will figure it out.

aafaq146 commented 2 years ago

i'm passing this to view and reply comments on my Post model @comments(['model' =>$post])

mabasic commented 2 years ago

Have you published the config file comments.php and changed the model value there?

aafaq146 commented 2 years ago

hey is here any possibliy or where i shoud change so i can see reply button if i'm not other user??

mabasic commented 2 years ago

You could change the policy rule I think. That will allow the commenter to reply to his own comment which does not make sense to me.

aafaq146 commented 2 years ago

ohk thanku..nice work