You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think you can do it from your package itself, it would be quite weird and a security nightmare, but you can always do it from the application that consume both of these packages via a key in composer.json : https://laravel.com/docs/9.x/packages#opting-out-of-package-discovery.
I don't know if your package is always installed alongside statamic, but you could offer both your standard service provider and an AggregateServiceProvider that contain yours and statamic main one.
Edit : I'm pretty sure service providers can only be run once, so adding this in your package service provider might do the trick.
class MyServiceProvider extends ServiceProvider
{
public function register()
{
// Force it to run first if installed
if (class_exists('Statamic\Providers\StatamicServiceProvider')) {
$this->app->register('Statamic\Providers\StatamicServiceProvider');
}
// ...
}
public function boot()
{
// ...
}
}
If what you want to do to the translater can be done with macro, registering those now should work as both the base translator is macroable and statamic extend the base one. If not it complicate things a bit.
Bug description
Statamic\Extensions\Translation\Translator
the problem is, if someone else registers a translator themselves, yours can get priority
and even though you call
CpServiceProvider
the problem is that the original $translator never gets the chance to do their own
get()
not sure what is the best solution... magic methods maybe?
How to reproduce
say, try to use statamic together with laravel-translation-manager
or any translation package that has its own translator implementation
Logs
No response
Versions
$ php please support:details
Statamic 3.2.35 Pro
Laravel 8.83.3
PHP 8.1.2
edalzell/blade-directives 3.5.2
optimoapps/statamic-bard-text-align 1.0.2
pecotamic/sitemap 1.2.7
Installation
Existing Laravel app
Additional details
No response
The text was updated successfully, but these errors were encountered: