Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 support #273

Open
osama-98 opened this issue Mar 15, 2024 · 10 comments
Open

Laravel 11 support #273

osama-98 opened this issue Mar 15, 2024 · 10 comments

Comments

@osama-98
Copy link

I got an error when I did update to Laravel11, please find the error message

   BadMethodCallException 

  Method Illuminate\Database\MySqlConnection::getDoctrineSchemaManager does not exist.

  at vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:112
    108▕      */
    109public function __call($method, $parameters)
    110▕     {
    111if (! static::hasMacro($method)) {
  ➜ 112throw new BadMethodCallException(sprintf(
    113'Method %s::%s does not exist.', static::class, $method
    114▕             ));
    115▕         }
    116▕

  i   Bad Method Call: Did you mean Illuminate\Database\MySqlConnection::getSchemaGrammar() ?

  1   vendor\reliese\laravel\src\Meta\MySql\Schema.php:273
      Illuminate\Database\Connection::__call("getDoctrineSchemaManager", [])

  2   [internal]:0
      Reliese\Meta\MySql\Schema::schemas(Object(Illuminate\Database\MySqlConnection))
@uacode
Copy link

uacode commented Mar 17, 2024

laravel/framework#48864

Removes DB::getDoctrineSchemaManager() method

@igun997
Copy link

igun997 commented Mar 19, 2024

you can modify like this , it cause doctrine types not supported on laravel 11

#208

@osama-98
Copy link
Author

@uacode
This is explaining why the error is being thrown. But, how to solve it?

@uacode
Copy link

uacode commented Mar 24, 2024

@osama-98 I commented in vendor (only for run DB migrations)

\Reliese\Meta\MySql\Schema::schemas

public static function schemas(Connection $connection)
    {
//        $schemas = $connection->getDoctrineSchemaManager()->listDatabases();
//        Schema::getDatabases();
        $schemas = [];

        return array_diff($schemas, [
            'information_schema',
            'sys',
            'mysql',
            'performance_schema',
        ]);
    }

@igun997
Copy link

igun997 commented Mar 24, 2024

@uacode This is explaining why the error is being thrown. But, how to solve it?

I resolved it on PR #208 you can direct edit your vendor folder

@vibonacci
Copy link

Could somebody please review and merge? New Laravel devs cannot use this as they start with Laravel 11 and will be forced to make their own Model files: 1 for each table.

@alphageek01
Copy link

@igun997 Your PR doesn't fix the issue completely.
There are still calls to the getDoctrineSchemaManager (in ...Postgres/Schema.php) which was removed in v11.

@igun997
Copy link

igun997 commented Apr 21, 2024

@igun997 Your PR doesn't fix the issue completely. There are still calls to the getDoctrineSchemaManager (in ...Postgres/Schema.php) which was removed in v11.

ah , i forget about it. coz i use mysql & mariadb as primary databases

@aavinseth
Copy link

any update on this? as still I am getting the Method Illuminate\Database\MySqlConnection::getDoctrineSchemaManager does not exist. error while runing the php artisan code:models command

@realitymatters
Copy link

any update on this? as still I am getting the Method Illuminate\Database\MySqlConnection::getDoctrineSchemaManager does not exist. error while runing the php artisan code:models command

Look a couple of comments back, this workaround works.

#273 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants