I have a file in one of my packages (Oauth2 Madewithlove package), where I have a function that I am using. In this function, I want to use a certain Facebook App for my local environment and a certain for my production environment. Therefore the function looks like this:
public function search($query = '', $type = '') {
if(App::environment('local')) {
$url = 'https://graph.facebook.com/search?key=value&access_token=********|***************&q='.str_replace(' ', '+', $query).'&type='.$type;
}
else {
$url = 'https://graph.facebook.com/search?key=value&access_token=***********|*****************&q='.str_replace(' ', '+', $query).'&type='.$type;
}
return json_decode(file_get_contents($url), true);
}
Where the starred out portions are the app ids and secrets. However, when running this, I get the error:
Class 'OAuth2\Provider\App' not found
with the filepath:
/vendor/madewithlove/laravel-oauth2/src/OAuth2/Provider/Facebook.php
This points to the App:environment line. I have already added this to my config in the bootstrap/start.php file:
$env = $app->detectEnvironment(array(
'local' => array('******-*******-MacBook-Pro.local'),
));
Any idea why I am getting the error? Thank you.