laravel-moderation icon indicating copy to clipboard operation
laravel-moderation copied to clipboard

Undefined index: column

Open nguyentranchung opened this issue 6 years ago • 8 comments

hi @hootlex I have encountered this error.

    "message": "Undefined index: column",
    "exception": "ErrorException",
    "file": "...\\vendor\\hootlex\\laravel-moderation\\src\\ModerationScope.php",
    "line": 404,

In ModerationScope.php are you sure always has attribute in $where array

    protected function isModerationConstraint(array $where, $column)
    {
            return $where['column'] == $column;
    }

nguyentranchung avatar Dec 08 '18 01:12 nguyentranchung

I try

    protected function isModerationConstraint(array $where, $column)
    {
        if (isset($where['column'])) {
            return $where['column'] == $column;
        }
        return false;
    }

I do not know True or False would be better.

nguyentranchung avatar Dec 08 '18 01:12 nguyentranchung

ping @hootlex

nguyentranchung avatar Dec 18 '18 05:12 nguyentranchung

ping @hootlex

dom235 avatar May 08 '19 12:05 dom235

@schranzer235 fork repo and fix it. Or using https://github.com/spatie/laravel-model-status package

nguyentranchung avatar May 13 '19 02:05 nguyentranchung

thanks for your reply! didn't noticed at first

dom235 avatar May 28 '19 11:05 dom235

@schranzer235 see my pull request https://github.com/hootlex/laravel-moderation/pull/40

nguyentranchung avatar May 28 '19 13:05 nguyentranchung

ping @hootlex

mallchin avatar Nov 20 '20 11:11 mallchin

Facing the same, any update?

nikhilbhatia22 avatar May 03 '21 05:05 nikhilbhatia22