PHPackages                             cdz/laravel-pagiscrap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. cdz/laravel-pagiscrap

ActiveLibrary[Queues &amp; Workers](/categories/queues)

cdz/laravel-pagiscrap
=====================

PagiScrap will efficiently extract paginated data from any API while optimizing performance with Laravel Queues. Each page is processed asynchronously, ensuring a smooth, non-blocking execution.

1.0.1(1y ago)03MITPHPPHP ^8.3CI passing

Since Mar 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Codeuz/laravel-pagiscrap)[ Packagist](https://packagist.org/packages/cdz/laravel-pagiscrap)[ GitHub Sponsors](https://github.com/cdz)[ RSS](/packages/cdz-laravel-pagiscrap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

PagiScrap
=========

[](#pagiscrap)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0c92df806fa51ac1033eb75f84fecfb078cbf6e449686e0640789053d68511a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63647a2f6c61726176656c2d706167697363726170)](https://packagist.org/packages/cdz/laravel-pagiscrap)[![GitHub Tests Action Status](https://camo.githubusercontent.com/97f529e315d205b128b23043359a2b721d870ff0dc1d89b95c257504a0c450b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f436f6465757a2f6c61726176656c2d7061676973637261702f72756e2d74657374732e796d6c)](https://github.com/Codeuz/laravel-pagiscrap/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0548071fe913f4617daef144436f452f2468d3d42eb794fb8e843dc21014b4c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63647a2f6c61726176656c2d7061676973637261702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cdz/laravel-pagiscrap)

PagiScrap will efficiently extract paginated data from any API while optimizing performance with Laravel Queues. Each page is processed asynchronously, ensuring a smooth, non-blocking execution.

Support
-------

[](#support)

- PHP &gt;= 8.3
- Laravel &gt;= 11

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require cdz/laravel-pagiscrap
```

Usage
-----

[](#usage)

### API class

[](#api-class)

First, you need to create a custom class that will handle the API calls. This class should implement the **PaginateApiRequestInterface** and define its methods:

- **pages(): int** - This method returns the total number of pages available for the API calls. It helps determine how many pages need to be processed.
- **process(int $page): mixed** - This method handles the API request for the given page. It makes an API call, retrieves the data, updates the total number of pages, and returns the extracted data.
- **after(mixed $result): void:** - This method is executed after the data is retrieved. You can use it to format and save the data before using it in your application.

Here is a complete example to illustrate how to use this class:

```
