I'm experiencing an issue with the Voyager package when trying to run migrations in Laravel 11. The error message I'm receiving is:
Method Illuminate\Database\MySqlConnection::getDoctrineColumn does not exist.
This is because the getDoctrineColumn method no longer exists in Laravel 11, as it was removed in favor of using the getSchemaBuilder method to retrieve column information.
I've tried updating the doctrine/dbal package to the latest version compatible with Laravel 11, but the issue persists. I've also tried modifying the relevant code in the migration file to use the getSchemaBuilder method instead of getDoctrineColumn, but the issue still occurs.
I've searched the Voyager package's GitHub issues and found a similar issue (https://github.com/reliese/laravel/issues/273) that was resolved by updating the schema to support the default schema on Postgres and Laravel 11 support on MySQL. However, the changes mentioned in that issue have not been applied to the Voyager package yet.
Steps to reproduce
Install Laravel 11 and the Voyager package.
Run php artisan migrate to run the migrations.
Observe the error message.
Expected behavior
The migrations should run successfully without any errors.
Screenshots
No response
Additional context
I believe the issue can be resolved by updating the schema in the Voyager package to use the getSchemaBuilder method instead of getDoctrineColumn. This change should be applied to the relevant migration files in the package.
Here's how the relevant code in the migration file can be modified to use the getSchemaBuilder method:
Open the migration file that contains the error(vendor/tcg/voyager/migrations/2017_11_26_015000_create_user_roles_table.php)
Locate the line that uses getDoctrineColumn(line 17 for me!)
Laravel version
11
PHP version
8.2
Voyager version
1.8.x-dev
Database
MySQL 8.0
Description
I'm experiencing an issue with the Voyager package when trying to run migrations in Laravel 11. The error message I'm receiving is:
This is because the
getDoctrineColumn
method no longer exists in Laravel 11, as it was removed in favor of using thegetSchemaBuilder
method to retrieve column information.I've tried updating the
doctrine/dbal
package to the latest version compatible with Laravel 11, but the issue persists. I've also tried modifying the relevant code in the migration file to use thegetSchemaBuilder
method instead ofgetDoctrineColumn
, but the issue still occurs.I've searched the Voyager package's GitHub issues and found a similar issue (https://github.com/reliese/laravel/issues/273) that was resolved by updating the schema to support the default schema on Postgres and Laravel 11 support on MySQL. However, the changes mentioned in that issue have not been applied to the Voyager package yet.
Steps to reproduce
Expected behavior
The migrations should run successfully without any errors.
Screenshots
No response
Additional context
I believe the issue can be resolved by updating the schema in the Voyager package to use the
getSchemaBuilder
method instead ofgetDoctrineColumn
. This change should be applied to the relevant migration files in the package.Here's how the relevant code in the migration file can be modified to use the
getSchemaBuilder
method:getDoctrineColumn
(line 17 for me!)This should resolve the issue without the need to modify the vendor files.