mercredi 5 octobre 2016

Retrieving credentials from DB to use in .env file

I have some credentials(twilio) which were placed in my .env file. However, now I am currently storing these credentials for each user in my database instead. I am trying to retrieve the information so that the application may use it just as if it were still in my .env file, but the application is not finding the credentials.

I tried calling it from the AppServiceProvider's boot method by using laravel's env() to see if it would work but it didn't.

I heard about something called memoization but didn't really understand how to implement it.


services.php

...
'twilio' => [
    'account_sid' => env('TWILIO_ACCOUNT_SID'),
    'auth_token' => env('TWILIO_AUTH_TOKEN'),
    'from' => env('TWILIO_FROM'),
],
...

What are the best approaches which could be taken with this problem? Any help with this would be greatly appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire