- How do I install polidog/php-chatwork-api in a Laravel application?
- Install it with Composer using composer require polidog/php-chatwork-api. It is a framework-agnostic PHP client rather than a Laravel package, so no service provider is auto-discovered. You will need to bind the client manually in one of your own service providers and supply your Chatwork API token from config.
- Is polidog/php-chatwork-api a Laravel package or a plain PHP library?
- It is a thin PHP client for Chatwork's REST API and has no Laravel-specific integration. In a Laravel app it works best as a peripheral adapter behind your own interface, such as ChatworkNotifier or ChatworkGateway. This keeps Chatwork response objects out of controllers, jobs, and domain code.
- Which PHP and Laravel versions does polidog/php-chatwork-api support?
- The package is framework-agnostic, so compatibility mainly depends on its PHP version constraint and its HTTP/Guzzle dependencies. Check the Composer constraints against your target Laravel and PHP matrix before committing, and run composer why-not to catch conflicts. Pin the package version and include it in your dependency-update reviews.
- How do I configure and store my Chatwork API token in Laravel?
- Store the token in your .env file and expose it through config/services.php or a dedicated config/chatwork.php file. Bind the client as a singleton in a service provider so the token is read from config rather than hardcoded. Keep the token out of source control and plan for rotation, since token leakage is a realistic risk with third-party API clients.
- How do I send a Chatwork message from a Laravel notification or queued job?
- Wrap the package in your own adapter with a method such as sendMessage, resolve it from the container, and call it from a queued job or a custom notification channel. Queue the delivery so Chatwork latency or failures do not block your request cycle. Keep the package call inside the adapter so call sites stay unchanged if you switch implementations later.
- Does polidog/php-chatwork-api handle Chatwork rate limits, retries, and timeouts?
- Expect to implement retry and timeout policy yourself, since the package is a thin wrapper without Laravel-native resilience features. Add HTTP timeouts, bounded retries with backoff, and structured logging around your adapter. Monitor rate-limit responses during a pilot in a low-risk room before expanding to more workflows.
- Is polidog/php-chatwork-api safe and maintained enough for production use?
- Treat it as moderate-to-high dependency risk: it has low visible adoption, a last release around August 2023, and unclear repository provenance. It is MIT licensed and fine for commercial use, but do not assume active maintenance, issue handling, or a security policy. Isolate it behind an adapter, pin the version, and monitor advisories so it remains replaceable.
- How should I structure a Laravel integration so the Chatwork package can be swapped later?
- Define an application-owned interface such as ChatworkGateway with methods like sendMessage, createTask, and getRoomMessages, and implement it with the package. Bind the implementation in a service provider and inject the interface wherever it is needed. If the package is abandoned, you can reimplement the gateway with Laravel's HTTP client or another SDK without touching call sites.
- How do I test a Chatwork integration in Laravel without calling the real API?
- Mock the Chatwork HTTP responses or fake your own ChatworkGateway interface in feature and unit tests. Add contract tests that verify payload shapes and exception mapping against recorded Chatwork responses. This keeps tests fast and deterministic while catching API drift early.
- What are the alternatives if polidog/php-chatwork-api is abandoned?
- The simplest fallback is a small adapter built on Laravel's HTTP client that calls the Chatwork REST endpoints you actually use. Because the package is a thin wrapper, replacing it usually means rewriting only the adapter class. Start with a proof-of-concept in a non-production room to confirm endpoint coverage and error behavior before switching.