I have an application with several tenants I'm working on, and when adding the socialite package, I tried to load the custom facebook client_id and client_secret for a specific website from the database. I cannot use env variables because each site will have its own custom facebook keys.
It seems you really cannot call the model method in the config / services.php file, as it may not have been loaded yet. I tried to view the request lifecycle documents to resolve this to no avail.
I also tried to create a service provider to get the value from my business model method and set it as a constant, but still, by the time it is available in the application, the config / services.php file was loaded.
Here, where I want the database value to be:
configurations /services.php
'facebook' => [
'client_id' => \App\Business::getAppKeys()->fb_client_id,
'client_secret' => 'your‐fb‐app‐secret',
'redirect' => 'http://your‐callback‐url',
],
Error:
Fatal error: function call of member function () at zero
source
share