You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Possible solution: in \vendor\tcg\voyager\src\Database\Schema\SchemaManager::getColumnIndexes($table, $column), return array_values() of the collect()->toArray():
return array_values(collect($tableIndexes)->filter(function ($index) use ($column) {
return in_array($column, $index['columns']);
})->toArray());
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
The text was updated successfully, but these errors were encountered: