- How do I install vluzrmos/slack-api in a Laravel application?
- Install it with composer require vluzrmos/slack-api, then publish the package config file and add your Slack token to the matching environment variable. On Laravel versions with package auto-discovery the service provider and Slack facade are registered for you; on older releases you add them to config/app.php manually. After that you can call Slack endpoints directly through the facade.
- Which Laravel and PHP versions does vluzrmos/slack-api support?
- There is no reliable version matrix in the package overview, so read the composer.json constraints before planning anything. Older Laravel wrappers often lack the return types and contract signatures required by Laravel 9, 10 and 11, so run a quick install spike against your target major. Confirm both the illuminate/support constraint and the guzzlehttp/guzzle constraint, since a single Guzzle pin conflict turns this into a fork-or-replace decision.
- How do I send a Slack message with the Slack facade?
- The facade forwards dynamically to Slack Web API endpoint names, so you call something like Slack::chat('postMessage', [...]) with a payload containing channel and text. The wrapper is a thin passthrough rather than a typed SDK, so the parameter names are whatever Slack documents for that endpoint. Always pass the full payload array and check the response for an ok key.
- Does vluzrmos/slack-api throw an exception when Slack returns ok: false?
- Slack returns HTTP 200 with an ok false body for most API-level failures, and thin passthrough wrappers frequently only surface Guzzle transport exceptions. Verify in a spike whether an ok false response throws or is returned silently as an array. Until you confirm it, wrap each call and check the ok flag yourself before assuming the message was delivered.
- Is vluzrmos/slack-api safe and maintained enough for production use?
- It is a single-maintainer package with a small dependent base and no visible commercial backing, so treat the bus factor as a real risk. A recent release date is not proof of active maintenance; confirm the latest tag is a substantive change such as a Laravel or PHP support bump rather than a metadata artifact. Budget time to fork it if you adopt it, and check the code size first because it is intentionally small.
- Does the package handle Slack rate limiting and 429 Retry-After responses?
- There is no evidence of built-in 429 or Retry-After handling, and dynamic passthrough wrappers rarely add tiered throttling. Slack penalizes repeated 429s, so implement your own backoff and push bulk sends onto a Laravel queue. Treat rate limiting as your responsibility, not the package's.
- Can I use a bot token with granular scopes like chat:write instead of a legacy token?
- Configuration is just a token string in the published config, so the wrapper itself does not restrict the token type. The question is whether the endpoints you call assume legacy workspace tokens, which Slack deprecated in 2020. Use an xoxb bot token with the scopes Slack requires for that method, and test chat.postMessage explicitly before relying on it.
- How do I test Slack API calls in Laravel without hitting the real Slack API?
- Mock the Slack facade with shouldReceive, or swap the container binding for a fake implementation in your test suite. Because calls are dispatched through a dynamic __call passthrough, mocking is coarser than with a typed SDK and you get little static feedback about wrong method or parameter names. Return fixture payloads that mirror Slack responses, including the ok false case, so your error handling is exercised.
- What are the alternatives to vluzrmos/slack-api for Laravel Slack integration?
- For outbound notifications, Laravel's first-party laravel/slack-notification-channel is the default choice: better maintained, with webhook and bot token support. For richer Slack apps you are better served by the official Slack SDKs or a small hand-written Guzzle client you control. Consider this package only in a narrow band where you need a handful of Web API calls from a Laravel monolith and it verifiably supports your framework version.
- Does vluzrmos/slack-api support incoming webhooks and modern Slack apps?
- The blurb mentions incoming webhooks and outbound Web API calls, but the package is not an app framework. It does not cover Events API subscriptions, request signing verification, OAuth v2 install flows, interactivity or slash-command endpoints, Socket Mode, or Block Kit composition. If you need those, plan for a different tool rather than expecting this wrapper to grow into them.