samedi 6 février 2016

laraval 5.1 it is showing that Class 'Facebook\Facebook' not found

fb calling api for uploading photes

  <?php
  $fb = new Facebook\Facebook([
 'app_id' => '',
 'app_secret' => '',
 'default_graph_version' => 'v2.5',
  ]);

$data = [
 'message' => 'My awesome photo upload example.',
 'source' => $fb->fileToUpload('C:/xampp/htdocs/laravel5-learning/public/image/share/'.$name),
 ];

 try {
 // Returns a `Facebook\FacebookResponse` object
 $response = $fb->post('/me/photos', $data, '{access-token}');
 } catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
 echo 'Facebook SDK returned an error: ' . $e->getMessage();
 exit;
}


$graphNode = $response->getGraphNode();

echo 'Photo ID: ' . $graphNode['id'];

  ?>

classes i am using in my controller file

i think i need to include more classes that will work good.. please help me in telling that i need to call use Illuminate\Http\Request; //use Session; //use Request; use DB; use DateTime; //use App\Locations; use App\Http\Requests; use App\Http\Controllers\Controller;

    use Facebook\Facebook as Facebook;
    use Facebook\FileUpload\FacebookFile;
    use Facebook\FacebookRequest;
    use Facebook\GraphObject;
    use Facebook\FacebookRequestException;

is this showing this error that Class 'Facebook\Facebook' not found



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire