Beginilah cara saya membuat sabun berfungsi di Laravel 5.1
- bersihkan instal laravel 5.1
- instal artisaninweb/laravel-soap
-
buat pengontrol SoapController.php
<?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 ->name('currency') ->wsdl('path/to/wsdl') ->trace(true); }); $data = [ 'user' => 'username', 'pass' => 'password', ]; // Using the added service SoapWrapper::service('currency', function ($service) use ($data) { var_dump($service->call('Login', [$data])); var_dump($service->call('Otherfunction')); }); } }
-
Buat rute di route Anda.php
Route::get('/demo', ['as' => 'demo', 'uses' => '[email protected]']);
Jika diminta, Anda juga dapat menggunakan ekstensi model seperti yang dijelaskan di sini