Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Can't add BREAD to table with multiple indexes #5936

Description

@parriondo

Laravel version

11.35.1

PHP version

8.3.12

Voyager version

1.8

Database

MySQL 8.0.3

Description

When adding a BREAD, it gives the following error:
Internal Server Error
ErrorException
Undefined array key 0
\vendor\tcg\voyager\src\Database\Schema\SchemaManager.php :77

The error occurs because the searched index is in position 5 of the index array. Thus, the function getColumnIndexes($table, $column) returns an array with a single element of index 4. Then, when $indexes[0]['type'] is evaluated, the exception is raised

Steps to reproduce

Add a BREAD for a table that has multiple indexes: 1 Primary key and 4 key (FK)

Expected behavior

Voayger should show the BREAD creation and configuration screen

Screenshots

Captura de pantalla 2024-12-17 080542

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions