mahmoudtrageh
1 month ago
180
2
Laravel

firestore pagination with laravel

Posted 1 month ago by mahmoudtrageh

I want to understand this code ?!

how can I change this link (url) to fit pagination of any page ?

$limit    = 10;

    $url  = 'https://firestore.googleapis.com/v1beta1/projects/zadcall/databases/(default)/documents/users?	key=AIzaSyD8LI57uBNjHG_r8QWpSvt8DXsdd5S5eKw&pageSize='.$limit.'&pageToken='.$nextPageToken;

    $json                     = json_decode(file_get_contents($url), true);

    $calls                    = $json['documents'];

    if(isset($json['nextPageToken'])){

      $nextPageToken            = $json['nextPageToken'];

    }else{

      $nextPageToken            = null;

    }

Please sign in or create an account to participate in this conversation.