gr8shivam / laravel-sms-api

Laravel package to provide SMS API integration.
MIT License
99 stars 29 forks source link

Use with lumen ? #11

Closed scramatte closed 5 years ago

scramatte commented 5 years ago

Hi,

I need to use your class with Lumen. I'm unable to declare SmsApi facade properly ...

Thank you

gr8shivam commented 5 years ago

Currently, Lumen isn't supported. Also, by default Lumen has Facades disabled.

gr8shivam commented 5 years ago

I don't recommend using it with Lumen, but if you want to use it with Lumen, you can follow the following steps:

  1. Register the service provider manually in bootstrap/app.php by adding:
    $app->register(Gr8Shivam\SmsApi\SmsApiServiceProvider::class);
  2. Copy the config file manually from vendor⁩/gr8shivam⁩/⁨laravel-sms-api⁩/src⁩/config to config directory in project root. If config directory doesn't exist, create it.
  3. Activate Facades by adding below code to bootstrap/app.php:
    $app->withFacades();
  4. Make Lumen use the copied config file by adding below code to bootstrap/app.php:
    $app->configure('sms-api');
  5. Follow the Instructions mentioned in this gist (https://gist.github.com/mabasic/21d13eab12462e596120) to get config_path in Lumen.

That's it!