20steps/collmex-bundle
Symfony2 bundle exposing Collmex accounting as a configurable service. Configure URL/account/login/password, inject or fetch the service, and call methods like getCustomerCount(). Early, incomplete implementation with plans for full CRUD, caching, and KPIs.
AppKernel, services.yml, Symfony2-specific service containers) is not natively compatible with Laravel’s service provider or container patterns.HttpClient, Contracts, or ServiceProvider patterns. The bundle uses Symfony2’s HttpClient (deprecated in Symfony 5+) and manual configuration.HttpClient with Laravel’s HttpClient or Guzzle.bind()/singleton().parameters.yml → Laravel’s .env or config/collmex.php).KernelEvents) via Laravel’s service providers or events system.ContainerInterface vs. Laravel’s Illuminate\Container\Container.parameters.yml vs. Laravel’s .env/config/ files.HttpClient vs. Laravel’s HttpClient/Guzzle.EventDispatcher vs. Laravel’s Events facade.HttpClient to replicate API calls directly (bypassing the bundle).Illuminate\Support\Facades\Http (Laravel 8+) or Guzzle..env for configuration (e.g., COLLMEX_URL, COLLMEX_ACCOUNT_ID).// app/Services/CollmexService.php
class CollmexService {
public function __construct(protected HttpClient $http) {}
public function fetchData() {
return $this->http->get(env('COLLMEX_URL'), [
'headers' => ['Authorization' => 'Bearer ' . env('COLLMEX_TOKEN')],
]);
}
}
bind() in a ServiceProvider.config/collmex.php instead of parameters.yml.HttpClient with Http facade.Event system.ServiceProvider:
// app/Providers/CollmexServiceProvider.php
public function register() {
$this->app->singleton('collmex', function ($app) {
return new CollmexService($app->make(HttpClient::class));
});
}
php -v and composer why-not php:^8.0.HttpFoundation).Http::fake()) to test error handling.parameters.yml to Laravel’s .env/config requires dual maintenance during transition..env (not committed to version control).symfony/http-client) would need to be replaced with Laravel-compatible alternatives.How can I help you explore Laravel packages today?