Open hshahdoost opened 5 years ago
The problem was solved by creating a new ServiceProvider for Beberlei but registering it's methods the way Gedmo was doing it
class BeberleiExtensionsServiceProvider extends BaseServiceProvider
{
public function boot(DoctrineManager $manager){
}
/**
* Register the service provider.
* @return void
*/
public function register()
{
$this->app['events']->listen('doctrine.extensions.booting', function () {
/**
* @var Registry $registry
*/
$registry = $this->app->make('registry');
foreach ($registry->getManagers() as $manager) {
$configuration = $manager->getConfiguration();
$configuration->setCustomDatetimeFunctions($this->datetime);
$configuration->setCustomNumericFunctions($this->numeric);
$configuration->setCustomStringFunctions($this->string);
}
});
}
}
Can reproduce this issue in laravel 8.1
too. @hshahdoost 's fix is still working.
This is working fine for me. We would need a more detailed error and example code of what is not working to help more.
I'm using the following packages and have just upgraded into Laravel 5.7 (from 5.4)
I don't know why this is happening, but after upgrading into Laravel 5.7, I can no longer use
BeberleiExtensions
methods such asMonth
. I have removed the updated package service providers from my app config and kept beberlei and gedmo there. So far everything. Here is how I have registered the service providersThe Gedmo library is working fine, but Berberlei doesn't get registered properly, Both of them are added to Providers in bootstrap and are registered after LaravelDoctrine. But there is a difference in the way Beberlei is registered which makes this happen. Beberlei is using the following code to register it's datetime functions in BeberleiExtensionsServiceProvider
While Gedmo is using a more sophisticated way of registering it's annotations (You can see it here)
The callback of
$manager->extendAll
is never called for some reason, while the callback of Gedmo is called properly.