hootlex / laravel-moderation

A simple Content Moderation System for Laravel 5.* that allows you to Approve or Reject resources like posts, comments, users, etc.
MIT License
527 stars 68 forks source link

Moderation Trait Issue #41

Closed lawkunchi closed 5 years ago

lawkunchi commented 5 years ago

I have a model and I added the Hootlex\Moderation\Moderatable trait as below

use Hootlex\Moderation\Moderatable;
class Post extends Model
{
    use Moderatable;
    ...
}

But my index blade that returns a list of submitted posts does not show unless I remove use Moderatable; from my model. So instead I added the trait to my controller, but now when I try to approve the post it gives this error Call to undefined method pending() reject() or postpone() . I also tried other ways to moderate an instance of a model provided in the documentation, and I get the same error. Please assist on a solution for thus error

lawkunchi commented 5 years ago

@hootlex ping

lawkunchi commented 5 years ago

I go the solution. So I found out if the strict mode is set to true it won't display resources unless approved public static $strictModeration = false;

So I then set it to false in order to edit the resources