webit/soap-api
webit/soap-api is a Laravel/PHP package for integrating SOAP APIs into your application. It provides a lightweight foundation for building SOAP clients and services, helping streamline WSDL-based integrations and keep SOAP logic organized within Laravel projects.
webit/soap-api is a Laravel package (circa 2017, dbojdo) that wraps PHP’s ext-soap and provides helpers for exposing and consuming SOAP services inside a Laravel app. It is old, unversioned, and has no dependents — treat it as a reference implementation you will likely fork rather than a drop-in dependency.
Minimal setup:
composer require webit/soap-api — expect conflicts on modern Laravel (it targets Laravel 5.x / PHP 7.0–7.1). If it won’t install, pull the repo in as a path repository or vendor a copy into packages/.php -m | grep soap. Most build failures on first contact are actually missing ext-soap, not a package bug.config/app.php. In Laravel 5.5+ auto-discovery won’t fire because the package predates it.php artisan vendor:publish and scan the published file for the WSDL path/cache and namespace options — that is the first thing to read.src/ before writing code. With no README docs to speak of, the source is the documentation. Look for: a base controller, a WSDL builder, any annotation or config-driven service definitions, and a client wrapper.If composer require produces a dependency resolution conflict, stop and read the composer.json in the repo — the answer is almost always the Laravel/illuminate/* version constraint.
Server-side (exposing a SOAP API):
SoapServer uses a specific URI from the WSDL, so the method names must match the WSDL exactly.VerifyCsrfToken::$except, or route it through the api group without session middleware).stdClass from operation methods. Anything that serializes to the XSD type is fine; Eloquent models are not — map them first.Client-side (consuming a remote SOAP service):
SoapClient::__setLocation() and the WSDL cache options (cache_wsdl, stream_context) via the package config rather than editing the vendor source — that is what the config file is for.trace: true in non-production so __getLastRequest() / __getLastResponse() are available for debugging.Integration tips:
SoapClient final classes make direct mocking painful — the wrapper is the point.resources/soap/ and reference it from config, so a schema change is a reviewable diff.SoapClient signatures and Laravel container internals have both changed since.docker-php-ext-install soap or apt-get install php-soap early.illuminate/* constraints. If you need it on Laravel 10/11, fork and widen the constraints — usually just the composer.json and possibly ServiceProvider method signatures.cache_wsdl). When you edit the WSDL and nothing changes, that’s the cause — clear it or set WSDL_CACHE_NONE in dev.SoapFault is not an exception hierarchy you expect. Catch \SoapFault explicitly, log getMessage() and getTrace() (the trace carries the upstream XML), and translate it to an application-level error before it leaks as a 500.targetNamespace and your binding produces looks like we got no XML document or encoding: object has no 'X' property — cryptic messages that hide a namespace typo.SoapClient.php-soap/* (php-soap/engine, php-soap/psr18-transport) or wsdltophp/packagebase first — they’re maintained and PHP 8-ready. Reach for webit/soap-api only when you’re inheriting it.How can I help you explore Laravel packages today?