Akshay Khale Akshay Khale - 6 months ago 109
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...


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);