Akshay Khale Akshay Khale - 1 year ago 319
PHP Question

PHP Soapclient in Laravel 5

I want to use php's built in SoapClient class in laravel 5

I tried using it directly is shows error saying

Class 'App\Http\Controllers\SoapClient' not found.

I tried adding
in aliases array in
like this

'SoapClient' => SoapClient::class

Still not working

what should I do?

Thanks in Advance...

Answer Source

The class needs to be imported, so either do that at the top:

use SoapClient;

or reference it directly later:

$client = new \SoapClient($wsdl, $options);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download