Skip to content

register fake driver at service provider#336

Merged
jleonardolemos merged 1 commit intomasterfrom
feature/register-fake-driver
Jan 13, 2026
Merged

register fake driver at service provider#336
jleonardolemos merged 1 commit intomasterfrom
feature/register-fake-driver

Conversation

@jleonardolemos
Copy link
Collaborator

Description

The fake driver should be registered at ServiceProvider to be extensible and swapable.
This MR juster resolve the fake driver at service container instead of using new statement.
This MR is not a BC

Copy link

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR successfully refactors the fake driver registration to use Laravel's service container instead of direct instantiation, which improves extensibility and follows Laravel best practices.

Key Changes:

  • ✅ Added PigeonFake registration as singleton in PigeonServiceProvider
  • ✅ Updated Pigeon::fake() to resolve from container using app('pigeon-fake')
  • ✅ Proper import added for PigeonFake class

Action Required:

  • Update the provides() method to include 'pigeon-fake' for proper service discovery

The implementation is solid and maintains backward compatibility while improving the architecture. Once the provides() method is updated, this will be ready to merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines +36 to +38
$this->app->singleton('pigeon-fake', static function ($app) {
return new PigeonFake($app);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're now registering 'pigeon-fake' as a singleton in this service provider, you should also add it to the provides() method return array. The method currently only returns ['pigeon'] but should return ['pigeon', 'pigeon-fake'] to ensure proper service discovery when the provider is deferred.

@jleonardolemos jleonardolemos merged commit 63f935d into master Jan 13, 2026
11 checks passed
@jleonardolemos jleonardolemos deleted the feature/register-fake-driver branch January 13, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant