title: Laravel 5.1 consuming soap wsdl service using controller and model
body: <p>Currently I'm using php and nusoap and wanted to convert it to Laravel.</p>
  
  <p>When creating the soap calls I use data out of a mysql database.</p>
  
  <p>So I think I would need a model (to get my data) and a controller (to create request).</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use Artisaninweb\SoapWrapper\Facades\SoapWrapper;
  class SoapController extends Controller {
  public function demo()
  {
  // Add a new service to the wrapper
      SoapWrapper::add(function ($service) {
         $service
         -&gt;name('currency')
         -&gt;wsdl('path/to/wsdl')
         -&gt;trace(true);
         -&gt;options(['user' =&gt; 'username', 'pass' =&gt; 'password']);
       });
  
  // Using the added service
  SoapWrapper::service('currency', function ($service) {
  var_dump($service-&gt;getFunctions());
  var_dump($service-&gt;call('Otherfunction'));
  });
  }
  }
  </code></pre>
  
  <p>from <a href="https://github.com/artisaninweb/laravel-soap" rel="nofollow">laravel-soap</a> I couldn't find a tutorial on how to send login parameters prior to any other request. In the example 'using the added service' I see the login credentials but it doesn't work.</p>