{"id":13669406,"url":"https://github.com/notfalsedev/laravel-soap","last_synced_at":"2025-07-05T15:17:02.887Z","repository":{"id":45933627,"uuid":"22673990","full_name":"notfalsedev/laravel-soap","owner":"notfalsedev","description":"A soap client wrapper for Laravel","archived":false,"fork":false,"pushed_at":"2021-11-26T18:24:24.000Z","size":51,"stargazers_count":633,"open_issues_count":55,"forks_count":122,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-13T02:37:18.756Z","etag":null,"topics":["laravel","lumen","php","soap"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notfalsedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-06T07:41:47.000Z","updated_at":"2024-12-21T16:43:29.000Z","dependencies_parsed_at":"2022-09-23T09:32:13.395Z","dependency_job_id":null,"html_url":"https://github.com/notfalsedev/laravel-soap","commit_stats":null,"previous_names":["artisaninweb/laravel-soap"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notfalsedev%2Flaravel-soap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notfalsedev%2Flaravel-soap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notfalsedev%2Flaravel-soap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notfalsedev%2Flaravel-soap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notfalsedev","download_url":"https://codeload.github.com/notfalsedev/laravel-soap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251089410,"owners_count":21534511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","lumen","php","soap"],"created_at":"2024-08-02T08:01:12.555Z","updated_at":"2025-04-27T04:32:42.225Z","avatar_url":"https://github.com/notfalsedev.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"Laravel SoapClient Wrapper\n===========================\n\nA SoapClient wrapper integration for Laravel.\u003cbr/\u003e\nMakes it easy to use Soap in a Laravel application.\u003cbr/\u003e\n\nPlease report any bugs or features here: \u003cbr/\u003e\nhttps://github.com/artisaninweb/laravel-soap/issues/\n\nInstallation\n============\n\n## Laravel\n\n####Installation for Laravel 5.2 and above:\n\nRun `composer require artisaninweb/laravel-soap`\n\nAdd the service provider in `app/config/app.php`.\n\n```php\nArtisaninweb\\SoapWrapper\\ServiceProvider::class, \n```\n\nTo use the alias, add this to the aliases in `app/config/app.php`.\n\n```php\n'SoapWrapper' =\u003e Artisaninweb\\SoapWrapper\\Facade\\SoapWrapper::class,  \n```\n\n\n####Installation for Laravel 5.1 and below :\n\n\nAdd `artisaninweb/laravel-soap` as requirement to composer.json\n\n```javascript\n{\n    \"require\": {\n        \"artisaninweb/laravel-soap\": \"0.3.*\"\n    }\n}\n```\n\n\u003e If you're using Laravel 5.5 or higher you can skip the two config setups below.\n\nAdd the service provider in `app/config/app.php`.\n\n```php\n'Artisaninweb\\SoapWrapper\\ServiceProvider'\n```\n\nTo use the facade add this to the facades in `app/config/app.php`.\n\n```php\n'SoapWrapper' =\u003e 'Artisaninweb\\SoapWrapper\\Facade'\n```\n\n## Lumen\n\nOpen `bootstrap/app.php` and register the required service provider:\n```php\n$app-\u003eregister(Artisaninweb\\SoapWrapper\\ServiceProvider::class);\n```\n\nregister class alias:\n```php\nclass_alias('Artisaninweb\\SoapWrapper\\Facade', 'SoapWrapper');\n```\n\n*Facades must be enabled.*\n\n\nUsage\n============\n\nHow to add a service to the wrapper and use it.\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse Artisaninweb\\SoapWrapper\\SoapWrapper;\nuse App\\Soap\\Request\\GetConversionAmount;\nuse App\\Soap\\Response\\GetConversionAmountResponse;\n\nclass SoapController\n{\n  /**\n   * @var SoapWrapper\n   */\n  protected $soapWrapper;\n\n  /**\n   * SoapController constructor.\n   *\n   * @param SoapWrapper $soapWrapper\n   */\n  public function __construct(SoapWrapper $soapWrapper)\n  {\n    $this-\u003esoapWrapper = $soapWrapper;\n  }\n\n  /**\n   * Use the SoapWrapper\n   */\n  public function show() \n  {\n    $this-\u003esoapWrapper-\u003eadd('Currency', function ($service) {\n      $service\n        -\u003ewsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')\n        -\u003etrace(true)\n        -\u003eclassmap([\n          GetConversionAmount::class,\n          GetConversionAmountResponse::class,\n        ]);\n    });\n\n    // Without classmap\n    $response = $this-\u003esoapWrapper-\u003ecall('Currency.GetConversionAmount', [\n      'CurrencyFrom' =\u003e 'USD', \n      'CurrencyTo'   =\u003e 'EUR', \n      'RateDate'     =\u003e '2014-06-05', \n      'Amount'       =\u003e '1000',\n    ]);\n\n    var_dump($response);\n\n    // With classmap\n    $response = $this-\u003esoapWrapper-\u003ecall('Currency.GetConversionAmount', [\n      new GetConversionAmount('USD', 'EUR', '2014-06-05', '1000')\n    ]);\n\n    var_dump($response);\n    exit;\n  }\n}\n```\n\nService functions\n============\n```php\n$this-\u003esoapWrapper-\u003eadd('Currency', function ($service) {\n    $service\n        -\u003ewsdl()                 // The WSDL url\n        -\u003etrace(true)            // Optional: (parameter: true/false)\n        -\u003eheader()               // Optional: (parameters: $namespace,$name,$data,$mustunderstand,$actor)\n        -\u003ecustomHeader()         // Optional: (parameters: $customerHeader) Use this to add a custom SoapHeader or extended class                \n        -\u003ecookie()               // Optional: (parameters: $name,$value)\n        -\u003elocation()             // Optional: (parameter: $location)\n        -\u003ecertificate()          // Optional: (parameter: $certLocation)\n        -\u003ecache(WSDL_CACHE_NONE) // Optional: Set the WSDL cache\n    \n        // Optional: Set some extra options\n        -\u003eoptions([\n            'login' =\u003e 'username',\n            'password' =\u003e 'password'\n        ])\n\n        // Optional: Classmap\n        -\u003eclassmap([\n          GetConversionAmount::class,\n          GetConversionAmountResponse::class,\n        ]);\n});\n```\n\nClassmap\n============\n\nIf you are using classmap you can add folders like for example:\n- App\\Soap\n- App\\Soap\\Request\n- App\\Soap\\Response\n\nRequest: App\\Soap\\Request\\GetConversionAmount\n\n```php\n\u003c?php\n\nnamespace App\\Soap\\Request;\n\nclass GetConversionAmount\n{\n  /**\n   * @var string\n   */\n  protected $CurrencyFrom;\n\n  /**\n   * @var string\n   */\n  protected $CurrencyTo;\n\n  /**\n   * @var string\n   */\n  protected $RateDate;\n\n  /**\n   * @var string\n   */\n  protected $Amount;\n\n  /**\n   * GetConversionAmount constructor.\n   *\n   * @param string $CurrencyFrom\n   * @param string $CurrencyTo\n   * @param string $RateDate\n   * @param string $Amount\n   */\n  public function __construct($CurrencyFrom, $CurrencyTo, $RateDate, $Amount)\n  {\n    $this-\u003eCurrencyFrom = $CurrencyFrom;\n    $this-\u003eCurrencyTo   = $CurrencyTo;\n    $this-\u003eRateDate     = $RateDate;\n    $this-\u003eAmount       = $Amount;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCurrencyFrom()\n  {\n    return $this-\u003eCurrencyFrom;\n  }\n\n  /**\n   * @return string\n   */\n  public function getCurrencyTo()\n  {\n    return $this-\u003eCurrencyTo;\n  }\n\n  /**\n   * @return string\n   */\n  public function getRateDate()\n  {\n    return $this-\u003eRateDate;\n  }\n\n  /**\n   * @return string\n   */\n  public function getAmount()\n  {\n    return $this-\u003eAmount;\n  }\n}\n```\n\nResponse: App\\Soap\\Response\\GetConversionAmountResponse\n\n```php\n\u003c?php\n\nnamespace App\\Soap\\Response;\n\nclass GetConversionAmountResponse\n{\n  /**\n   * @var string\n   */\n  protected $GetConversionAmountResult;\n\n  /**\n   * GetConversionAmountResponse constructor.\n   *\n   * @param string\n   */\n  public function __construct($GetConversionAmountResult)\n  {\n    $this-\u003eGetConversionAmountResult = $GetConversionAmountResult;\n  }\n\n  /**\n   * @return string\n   */\n  public function getGetConversionAmountResult()\n  {\n    return $this-\u003eGetConversionAmountResult;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotfalsedev%2Flaravel-soap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotfalsedev%2Flaravel-soap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotfalsedev%2Flaravel-soap/lists"}