laravel-doctrine / orm

An integration library for Laravel and Doctrine ORM
MIT License
829 stars 178 forks source link

2.0 #542

Closed eigan closed 1 year ago

eigan commented 1 year ago

Tracking issue for everything related to laravel-doctrine 2.0

soltmar commented 1 year ago

HI @eigan,

Do you guys have timeframe for supporting L10 and DBAL 3 ?

akalongman commented 1 year ago

Please, add Laravel 10 support

soltmar commented 1 year ago

Is there anything we can do to help this happening and speed things up?

eigan commented 1 year ago

You can use DBAL 3 with "laravel-doctrine/orm": "^2@dev", and "laravel-doctrine/migrations": "^3@dev",. We have done so for a while in production. Feel free to open a PR with support for Laravel 10 targeting the 2.0 branch

77web commented 1 year ago

I've opened PRs to allow Laravel10 with laravel-doctrine/orm v2 in orm, migrations, extensions.

worked fined in my project :smile:

yemkareems commented 1 year ago

Hi Team, Any specific timeline to support laravel 10 and doctrine 3

eigan commented 1 year ago

@yemkareems See my comment https://github.com/laravel-doctrine/orm/issues/542#issuecomment-1638001636

yemkareems commented 1 year ago

@eigan When i use "laravel-doctrine/orm": "^2@dev" with "doctrine/dbal": "3.6.5" i get Doctrine\DBAL\DriverManager::getConnection(): Argument #1 ($params) must be of type array, Doctrine\DBAL\Connection given, called in vendor/laravel-doctrine/orm/src/EntityManagerFactory.php on line 129. Also if i try to use 3.4.0 doctrine/dbal i get setSchemaManagerFactory undefined. So not sure what is the right combination of the doctrine/dbal and laravel-doctrine/orm to use to get it to work without errors

talkinnl commented 1 year ago

@patrickbrouwers : So how do we continue? I see a checklist in the issue description, but apparently projects are already using Laravel 10 with 2@dev in production as per @eigan .

It seems to me that 2.0 could be released by now? Or how can I/we/someone help? Maybe it's just fine to postpone the last b/c break discussion to a later point?

akalongman commented 1 year ago

I think 2.0 should be released by now

soltmar commented 1 year ago

I've been using 2@dev without any issues so far. One exception is on phpstan / phpstan-doctrine. Since upgrade to Laravel 10 and laravel-doctrine 2@dev I've started to receive phpstan messages about createQueryBuilder() method.

phpstan: Call to an undefined method Doctrine\Persistence\ObjectRepository::createQueryBuilder().

image

Doing the same thing as above but with usage of app('em') instead of EntityManager facade seems to be ok:

app('em')->getRepository(Companies::class)->createQueryBuilder('c')

Problem seems to happen with these versions:

phpstan/phpstan - 1.8.11             
phpstan/phpstan-doctrine - 1.3.28 
laravel-doctrine/extensions - 1.6.0
laravel-doctrine/orm - 2.0.0 
laravel/framework - v10.28.0 

but not with these:

phpstan/phpstan - 1.8.11
phpstan/phpstan-doctrine - 1.3.28 
laravel-doctrine/extensions - 1.5.4 
laravel-doctrine/orm - 1.7.13 
laravel/framework - v8.83.27

So far I wasn't able to isolate the cause. I've only found that changing line 19 in Facades/EntityManager.php helps:

// From
 * @method static \Doctrine\Persistence\ObjectRepository getRepository(string $className)
// To
 * @method static \Doctrine\ORM\EntityRepository getRepository(string $className)

Should I open new issue related to laravel-doctrine 2.0 ?

eigan commented 1 year ago

@soltmar Seems like using EntityRepository as return is the correct solution. Open PR?

soltmar commented 1 year ago

Opened one here https://github.com/laravel-doctrine/orm/pull/566

gordinskiy commented 10 months ago

Support 2.0 in all laravel-doctrine packages

Is there still any plans to add support of this version to laravel-doctrine/fluent?