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.x Compatibility #117

Open
wants to merge 1 commit into
base: 2x
Choose a base branch
from

Conversation

laravel-shift
Copy link

This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 11.x.

Before merging, you need to:

  • Checkout the l11-compatibility branch
  • Review all comments for additional changes
  • Thoroughly test your package

If you do find an issue, please report it by commenting on this PR to help improve future automation.

@laravel-shift
Copy link
Author

⚠️ The latest version of Laravel has a dependency for phpunit/phpunit of ^10.5. If you would like to also upgrade your tests, you may run the PHPUnit 10 Shift for free.

@laravel-shift
Copy link
Author

ℹ️ Shift detected you do not have a CI workflow using GitHub Actions. If you would like, Shift can help you get started with the CI Generator. Although the Shift is paid, GitHub Actions is free and having a CI workflow will improve the stability and review process for your package.

@laravel-shift
Copy link
Author

❌ Laravel 11 has removed its dependency on doctrine/dbal. As such, all of Laravel's classes, methods, and configuration related Doctrine DBAL have been removed.

Shift detected potential uses of these within the following files. You should review these instances and, if they are still needed, reference the Upgrade Guide for native alternatives.

  • src/Command/GenerateModelsCommand.php
  • src/Processor/CustomPrimaryKeyProcessor.php
  • src/Processor/FieldProcessor.php
  • src/Processor/RelationProcessor.php
  • src/Processor/TableNameProcessor.php
  • src/TypeRegistry.php

@laravel-shift
Copy link
Author

⚗️ Using this package? If you would like to help test these changes or believe them to be compatible, you may update your project to reference this branch.

To do so, temporarily add Shift's fork to the repositories property of your composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/eloquent-model-generator.git"
        }
    ]
}

Then update your dependency constraint to reference this branch:

{
    "require": {
        "krlove/eloquent-model-generator": "dev-l11-compatibility",
    }
}

Finally, run: composer update

@ipkpjersi
Copy link

This one doesn't seem to work for me FWIW, at least for postgres:

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   BadMethodCallException 

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

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

      +2 vendor frames 

  3   [internal]:0
      Krlove\EloquentModelGenerator\TypeRegistry::__construct()
      +15 vendor frames 

  19  [internal]:0
      Illuminate\Container\Container::Illuminate\Container\{closure}()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

I removed this package from my project for now to continue with my Laravel 11 upgrade until this can be fixed, assuming that it's an issue with eloquent-model-generator.

@Jonyorker
Copy link

Can we get an update on this? It would be so handy to have this on L11.

@ipkpjersi
Copy link

ipkpjersi commented Feb 1, 2025

@Jonyorker You can use it temporarily fwiw, and see if that works, the instructions for that are here: #117 (comment)

I think this repo is no longer maintained.

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

Successfully merging this pull request may close these issues.

3 participants