简体   繁体   中英

Laravel: composer says it has installed library and updated composer.json but

but when I go to composer.json, the library ain't there showing.

I just wrote this:

php composer.phar require twilio/sdk

and I could see the typical running of dependencies and versions being installed and I even updated it to make sure it had actually installed it (otherwise it would complain nothing ain't there) but

when I went to routes and wrote this:

Route::match(array('GET', 'POST'), '/sms', function()
{
  $twiml = new Services_Twilio_Twiml();
  $twiml->say('Hello - sorry to ring in the WC', array('voice' => 'alice'));
  $response = Response::make($twiml, 200);
  $response->header('Content-Type', 'text/xml');
  return $response;
});

it says it can't find the class, so, either twilio is hiding from every predator or I don't know what.

Question:

So, eventually I would need to know the exact syntax to be added to the config app service providers but I can only find syntax for other libraries related to twilio which are not the official libraries for laravel and I d rather use twilio/sdk and not any other.

What would be the syntax for both the service provider and the alias façade?

Let's se.... And do you know what's the namespace? Because all you need in that case is at the top of the file:

use Path\To\Namespace\Class 

and that's all... Or...

$twiml = New Path\To\Namespace\Services_Twilio_Twiml();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM