Can't add BREAD to table with multiple indexes
Author: parriondoCreated Dec 17, 2024Updated Feb 7, 2025
Labelspossible bug
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
Additional context
No response
Source: thedevdojo/voyager