skrepr/teams-connector-bundle
A Symfony bundle for connecting your PHP application to Microsoft Teams. It provides configuration and services for sending notifications and channel messages, so you can wire Teams into your app without building the integration yourself.
composer require skrepr/teams-connector-bundle:^1.1 skrepr/teams-connector:^0.3. The bundle is Symfony-first (a DI bundle around skrepr/teams-connector), so in a Laravel app you generally get more value from the underlying connector plus your own thin service binding — check vendor/skrepr/teams-connector/README.md first, that is where the actual message/card API lives.config/services.php / .env as TEAMS_WEBHOOK_URL. Treat it as a credential — anyone with it can post to the channel.$this->app->singleton(TeamsConnector::class, fn () => new TeamsConnector(
config('services.teams.webhook_url'),
// inject the HTTP client explicitly; see Gotchas
));
SendTeamsMessage job that fires on a domain event (new lead, failed deploy, error threshold crossed). Build the card, dispatch the job onto a queue — do not call the webhook inline in a request cycle.App\Services\Teams\TeamsNotifier) with intent-named methods (notifyDeployment(), notifyLead()). Cards are verbose arrays; keeping that construction in one place stops the webhook URL and card schema leaking across the codebase.ShouldQueue jobs or a custom Laravel notification channel give you retries, backoff, and timeouts for free.teams.channels.alerts, teams.channels.deployments) and resolve the webhook URL by name in the job's constructor. Makes staging vs. production and per-team channels a config change, not a code change.sections/facts structure, not on string equality of the whole JSON.TeamsNotifier binding for a spy in the container and assert notifyX was called; keep the payload-level assertions in a smaller set of dedicated tests.Card::facts([...]), Card::section($title, $text, $facts, $actions). Teams renders facts as a two-column table — good for key/value alert data (env, commit, duration); free text is where you put the human sentence.skrepr/teams-connector 0.3.0 plus CI coverage for PHP 8.2 / Symfony 6.2. There are no new features, so the real risk is a 0.x minor bump on the underlying connector. Read that package's 0.3.0 diff/changelog before upgrading, and pin ^0.3 while it is pre-1.0.skrepr/teams-connector directly and keep your own small binding.0.3.0 gives no backward-compatibility promise. A composer update can break your card-building code without the bundle's version changing. Commit composer.lock and upgrade the connector deliberately.Http::fake() style testing, ensure the connector accepts a PSR-18/HttpClientInterface implementation you control rather than constructing its own. Verify the constructor signature in 0.3.0 — this is exactly the kind of thing a 0.x bump changes.backoff() is usually enough) and treat 4xx as non-retryable — an invalid card schema returns 400 every time, so retrying just burns queue workers.TeamsNotifier now so a future migration does not touch call sites.TEAMS_WEBHOOK_URL is unset in non-production environments rather than posting to a real channel from CI.How can I help you explore Laravel packages today?