- Is cybercog/youtrack-rest-php a Laravel package?
- No. It is a framework-agnostic PSR-7 client for the YouTrack REST API, and it ships no service provider, config publish, facade, or queue integration. In Laravel you would register YouTrackClient in the container and wrap it behind your own port or adapter. Budget for that small integration layer plus DTO mapping.
- How do I install and configure cybercog/youtrack-rest-php in Laravel?
- Install it with Composer alongside Guzzle 7 and the PSR-7/17/18 packages it depends on. Construct YouTrackClient with the provided Guzzle adapter and a TokenAuthorizer, then bind it as a singleton in a Laravel service provider. There is no package config to publish, so you own environment variables, credential handling, and any facade you want.
- Which Laravel and PHP versions does this YouTrack client support?
- The library is exercised on PHP 8.1 through 8.5 in CI and works with Laravel 9+ on PHP 8.1+. Laravel 11 and 12 require PHP 8.2+, which the library supports. Laravel-specific compatibility is really about your PHP version and dependency constraints, not a package service provider.
- How does authentication work with the YouTrack REST API client?
- Two strategies ship in-box: TokenAuthorizer for bearer or permanent tokens and CookieAuthorizer for username/password with cookie caching. Token auth is stateless and preferred; cookie auth adds session-expiry and CSRF failure modes, especially behind load balancers or Laravel Octane. There is no OAuth 2.0 flow, so if Security mandates OAuth or SSO you must build and own that flow.
- Does cybercog/youtrack-rest-php return typed DTOs for issues and projects?
- No. Responses are arrays wrapped in YouTrackResponse, so every consumer makes its own assumptions about response shape. That is the main architectural gap for a Laravel codebase. Plan a mapping layer from YouTrack issue, project, and user arrays to internal value objects to prevent array coupling from spreading.
- How do I handle YouTrack rate limits and 429 responses with this client?
- The library provides no built-in retry, backoff, rate-limit handling, or idempotency. A 429 surfaces as a generic ClientException because only 401 and 403 are specially mapped. Add your own Guzzle middleware or wrapper to retry, inspect throttling responses, and apply an external-ID or dedupe convention for non-idempotent writes.
- Can I swap the HTTP client or use PSR-7 middleware with this package?
- Yes. YouTrackClient depends on an HttpClient contract and ships a Guzzle adapter, and the package relies on PSR-7/17/18. You can substitute another PSR-compatible client or add middleware for proxies, telemetry, and mTLS. Keep the vendor behind your own port so the library remains swappable for raw Guzzle or a future SDK.
- How do I test Laravel code that uses cybercog/youtrack-rest-php?
- The library itself uses PHPUnit 10.5 feature tests with Guzzle MockHandler. In your application, mock the HttpClient contract or use a Guzzle handler stack with MockHandler to assert request paths, methods, and bodies. Isolating the client behind your own port also lets you unit-test domain code without HTTP at all.
- Does it work with YouTrack Cloud, standalone Server, and webhooks?
- It works with YouTrack Cloud and standalone instances, but the library exposes mostly pass-through REST paths. Cloud versus Server divergence and API deprecations land on you rather than on a versioned SDK contract. It covers outbound REST only; inbound webhooks or event-driven processing require separate implementation.
- Is cybercog/youtrack-rest-php actively maintained and safe for production?
- Quality signals are strong for its size: strict types, PHPStan level 8, PSR-12, and PHPUnit tests with a multi-PHP matrix. The risk is community size and bus factor, with around 37 stars and thin external validation. For production, treat it as a thin substrate and own the adapter, DTO mapping, retry, observability, and credential handling; otherwise a raw Guzzle wrapper may be simpler.