Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FacebookSdK working fine on localhost, NOT on server #190

Open
michielalbracht opened this issue Sep 1, 2017 · 0 comments
Open

FacebookSdK working fine on localhost, NOT on server #190

michielalbracht opened this issue Sep 1, 2017 · 0 comments

Comments

@michielalbracht
Copy link

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:

[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'),
        )));

    }

}

Can you help me please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant