Silber\Bouncer\Conductors\Traits\DisassociatesAbilities::getModelAbilityId PHP Method

getModelAbilityId() protected method

Get the ability ID for the given model.
protected getModelAbilityId ( string $ability, Model | string $model, array $attributes ) : integer | null
$ability string
$model Illuminate\Database\Eloquent\Model | string
$attributes array
return integer | null
    protected function getModelAbilityId($ability, $model, $attributes)
    {
        $onlyOwned = isset($attributes['only_owned']) ? $attributes['only_owned'] : false;
        return Models::ability()->byName($ability, true)->forModel($model, true)->where('only_owned', $onlyOwned)->value('id');
    }