SammyK/FacbeookSDK Is working fine as part of a command. But when I upload it to the server it gives the following error when the php artisan command is entered:
[Illuminate\Contracts\Container\BindingResolutionException]
Unresolvable dependency resolving [Parameter #1 [ <required> $url ]] in class SammyK\LaravelFacebookSdk\LaravelFacebookSdk
My code looks like this:
namespace App\Console\Components\Facebook;
use Illuminate\Console\Command;
use App\Events\Facebook\FacebookFetched;
use Illuminate\Support\Facades\App;
use SammyK;
class FetchFacebook extends Command
{
protected $signature = 'site:fetch-fb';
protected $description = 'Fetch Facebook Data';
public function handle(SammyK\LaravelFacebookSdk\LaravelFacebookSdk $fb)
{
$token = [[my_token]];
$fb->setDefaultAccessToken($token);
try {
$response = $fb->get((string) '[[ my request ]]');
} catch(\Facebook\Exceptions\FacebookSDKException $e) {
dd($e->getMessage());
$this->info($e->getMessage());
}
$node = $response->getGraphNode();
$this->info('likes: ' . $node['fan_count']);
event(new FacebookFetched(array(
'likes' => $node->getField('fan_count'),
)));
}
}
Dear all,
SammyK/FacbeookSDK Is working fine as part of a command. But when I upload it to the server it gives the following error when the php artisan command is entered:
My code looks like this:
Can you help me please?