Skip to content

Feature: Defer service provider #542

@henzeb

Description

@henzeb

Description

In theory, Bugsnag laravel should work with Laravel Zero. However, the register provider flow of laravel zero, currently prevents us from using bugsnag. That flow is as follows:

  1. Foundation providers are registered. This includes user configured providers
  2. Component service providers are registered. These include the log service provider.

As a result, "Target class [log] does not exist. " error is thrown. You can't prepend the log service provider in the configuration file or anywhere else, as the component service provider simply overwrites the current binding. this doesn't give any errors when using Log facade, but doesn't log anything to bugsnag either.

Describe the solution you'd like
two things can be done:

  1. The current service provider becomes a deferred service provider. This would give us some performance win as we do not use the Log facade everywhere all at once. This might be a breaking change, but I am not sure.
  2. A Laravel Zero specific provider that is deferred and extends the main service provider.

Describe alternatives you've considered
I've posted a similar bug report at the Laravel Zero github. Maybe there a solution may come up. for instance, a way to prepend providers. Although they already have the solution, which is the deferred service provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWe hope to fix this feature/bug in the future

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions