|
14 | 14 |
|
15 | 15 | class ServiceProvider extends BaseServiceProvider |
16 | 16 | { |
| 17 | + /** |
| 18 | + * List of configuration options that are Laravel specific and should not be sent to the base PHP SDK. |
| 19 | + */ |
| 20 | + private const LARAVEL_SPECIFIC_OPTIONS = [ |
| 21 | + // We do not want this setting to hit our main client because it's Laravel specific |
| 22 | + 'breadcrumbs', |
| 23 | + // We resolve the integrations through the container later, so we initially do not pass it to the SDK yet |
| 24 | + 'integrations', |
| 25 | + // This is kept for backwards compatibility and can be dropped in a future breaking release |
| 26 | + 'breadcrumbs.sql_bindings', |
| 27 | + // The base namespace for controllers to strip of the beginning of controller class names |
| 28 | + 'controllers_base_namespace', |
| 29 | + ]; |
| 30 | + |
17 | 31 | /** |
18 | 32 | * Boot the service provider. |
19 | 33 | */ |
@@ -92,18 +106,17 @@ protected function registerArtisanCommands(): void |
92 | 106 | */ |
93 | 107 | protected function configureAndRegisterClient(): void |
94 | 108 | { |
| 109 | + $userConfig = $this->getUserConfig(); |
| 110 | + |
| 111 | + Integration::setControllersBaseNamespace($userConfig['controllers_base_namespace']); |
| 112 | + |
95 | 113 | $this->app->bind(ClientBuilderInterface::class, function () { |
96 | 114 | $basePath = base_path(); |
97 | 115 | $userConfig = $this->getUserConfig(); |
98 | 116 |
|
99 | | - unset( |
100 | | - // We do not want this setting to hit our main client because it's Laravel specific |
101 | | - $userConfig['breadcrumbs'], |
102 | | - // We resolve the integrations through the container later, so we initially do not pass it to the SDK yet |
103 | | - $userConfig['integrations'], |
104 | | - // This is kept for backwards compatibility and can be dropped in a future breaking release |
105 | | - $userConfig['breadcrumbs.sql_bindings'] |
106 | | - ); |
| 117 | + foreach (self::LARAVEL_SPECIFIC_OPTIONS as $laravelSpecificOptionName) { |
| 118 | + unset($userConfig[$laravelSpecificOptionName]); |
| 119 | + } |
107 | 120 |
|
108 | 121 | $options = \array_merge( |
109 | 122 | [ |
|
0 commit comments