src/CachedClipboard.php
protected function compileModelAbilityIdentifiers($ability, $model)
    {
        if ($model === '*') {
            return ["{$ability}-*", "*-*"];
        }

        $model = $model instanceof Model ? $model : new $model;

        $type = $model->getMorphClass();

        $abilities = [
            "{$ability}-{$type}",
            "{$ability}-*",
            "*-{$type}",
            "*-*",
        ];

        if ($model->exists) {
            $abilities[] = "{$ability}-{$type}-{$model->getKey()}";
            $abilities[] = "*-{$type}-{$model->getKey()}";
        }

        return $abilities;
    }
protected function compileModelAbilityIdentifiers($ability, $model)
    {
        if ($model === '*') {
            return ["{$ability}-*", "*-*"];
        }

        $model = $model instanceof Model ? $model : new $model;

        $type = $model->getMorphClass();

        $abilities = [
            "{$ability}-{$type}",
            "{$ability}-*",
            "*-{$type}",
            "*-*",
        ];

        if ($model->exists) {
            $abilities[] = "{$ability}-{$type}-{$model->getKey()}";
            $abilities[] = "*-{$type}-{$model->getKey()}";
        }

        return $abilities;
    }
protected function compileModelAbilityIdentifiers ( $ ability , $ model ) { if ( $ model === '*' ) { return [ "{$ability}-*" , "*-*" ] ; } $ model = $ model instanceof Model ? $ model : new $ model ; $ type = $ model -> getMorphClass ( ) ; $ abilities = [ "{$ability}-{$type}" , "{$ability}-*" , "*-{$type}" , "*-*" , ] ; if ( $ model -> exists ) { $ abilities [ ] = "{$ability}-{$type}-{$model->getKey()}" ; $ abilities [ ] = "*-{$type}-{$model->getKey()}" ; } return $ abilities ; }
Compile a list of ability identifiers that match the given model.

@param  string  $ability
@param  \Illuminate\Database\Eloquent\Model|string  $model
@return array
Compile a list of ability identifiers that match the given model .