@php
    $bienesFieldScope = $bienesFieldScope ?? 'pagina';
    $codigoIndex = array_search('codigo', $generalColumns, true);
    $generalColumnsBeforeCodigo = $codigoIndex === false ? $generalColumns : array_slice($generalColumns, 0, $codigoIndex);
    $generalColumnsAfterCodigo = $codigoIndex === false ? [] : array_slice($generalColumns, $codigoIndex + 1);
    $gridPartial = $bienesFieldScope === 'modal'
        ? 'administracion.crud.partials.comun.formulario.dominios-modal.rejilla-compartida'
        : 'administracion.crud.partials.comun.formulario.dominios-pagina.rejilla-compartida';
@endphp

@include($gridPartial, ['generalColumns' => $generalColumnsBeforeCodigo])
@include('administracion.crud.partials.comun.formulario.bienes.campo-codigo', ['bienesFieldScope' => $bienesFieldScope])
@include($gridPartial, ['generalColumns' => $generalColumnsAfterCodigo])