src/Database/Models.php
protected static function isOwnedVia($attribute, Model $authority, Model $model)
    {
        if ($attribute instanceof Closure) {
            return $attribute($model, $authority);
        }

        return $authority->getKey() == $model->{$attribute};
    }
protected static function isOwnedVia($attribute, Model $authority, Model $model)
    {
        if ($attribute instanceof Closure) {
            return $attribute($model, $authority);
        }

        return $authority->getKey() == $model->{$attribute};
    }
protected static function isOwnedVia ( $ attribute , Model $ authority , Model $ model ) { if ( $ attribute instanceof Closure ) { return $ attribute ( $ model , $ authority ) ; } return $ authority -> getKey ( ) == $ model -> { $ attribute } ; }
Determines ownership via the given attribute.

@param  string|\Closure  $attribute
@param  \Illuminate\Database\Eloquent\Model  $authority
@param  \Illuminate\Database\Eloquent\Model  $model
@return bool
Determines ownership via the given attribute .