\App::bound() may be correct.
Recent versions of laravel (maybe> = 5.3, I donβt know for sure) register service providers differently by default.
For example, a new registration method:
$this->app->singleton(MyNamespace\MyClass::class, function() { } );
instead of the old:
$this->app->singleton('MyClassOrAnyConvenientName', function() { } );
As a result, we should use App::make('\MyNamespace\MyClass') instead of App::make('MyClassOrAnyConvenientName') to solve the service.
We support a library that should support both versions. Therefore, we use \App::bound() to determine if the old or new service name format is registered in the container. class_exists() did work for the new laravel, but did not work as expected for the older ones, because on older systems we did not properly name Facade for this service (the facade name is different from the registered service name) and class_exists() returned false .
source share