PHPackages                             naimsolong/laravel-data-extractor - 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. naimsolong/laravel-data-extractor

ActiveLibrary

naimsolong/laravel-data-extractor
=================================

A data extractor based on models and it's relationship

1.0.1(9mo ago)16MITPHPPHP ^8.2||^8.3CI passing

Since Jul 6Pushed 9mo agoCompare

[ Source](https://github.com/naimsolong/laravel-data-extractor)[ Packagist](https://packagist.org/packages/naimsolong/laravel-data-extractor)[ Docs](https://github.com/naimsolong/laravel-data-extractor)[ GitHub Sponsors](https://github.com/naimsolong)[ RSS](/packages/naimsolong-laravel-data-extractor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (6)Used By (0)

A data extractor based on models and it's relationship
======================================================

[](#a-data-extractor-based-on-models-and-its-relationship)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d37a81da664961fb62ef51b918a9ab435f3256930adc65764bda015655b3c746/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e61696d736f6c6f6e672f6c61726176656c2d646174612d657874726163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/naimsolong/laravel-data-extractor)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fab5d73135dccc742f365a0b3f3405641f3716093c3886cc734efd13f3fa9efb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e61696d736f6c6f6e672f6c61726176656c2d646174612d657874726163746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/naimsolong/laravel-data-extractor/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/625547addd9324af1ae2872e8a6ce3cc5ab67f1581a675feb22099d12ab12975/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e61696d736f6c6f6e672f6c61726176656c2d646174612d657874726163746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/naimsolong/laravel-data-extractor/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ba683451d4b3272eef442c2b2d2ab47ec1495150d2a466ef8d27fa3992c4e84a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e61696d736f6c6f6e672f6c61726176656c2d646174612d657874726163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/naimsolong/laravel-data-extractor)

A Laravel package for extracting data from Eloquent models and their relationships with flexible configuration options. This package provides a simple and intuitive way to extract structured data from your models, making it perfect for API responses, data exports, or any scenario where you need to transform model data into a specific format.

What It Does
------------

[](#what-it-does)

The extractor leverages Laravel's relationship system to automatically include related data based on your configuration, while providing fine-grained control over which fields are included or excluded from the extraction process.

You can use the available options inside config file:

```
use NaimSolong\DataExtractor\Extract;

// Option
(new Extract)
  ->option('User')
  ->queryId(4)
  ->toSql();

// Source
(new Extract)
  ->source('session')
  ->queryId(3)
  ->toSql();
```

Or you can use model that you have queried:

```
use NaimSolong\DataExtractor\Extract;
use App\Models\User;

// Extract directly
(new Extract)
  ->toSql(
    User::get()
  );
```

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

[](#installation)

You can install the package via composer:

```
composer require naimsolong/laravel-data-extractor
```

You can publish the config file with:

```
php artisan vendor:publish --tag="data-extractor-config"
```

This is the contents of the published config file:

```
return [
    'is_enabled' => env('DATA_EXTRACTOR_ENABLED', false),

    'options' => [
        [
            'name' => 'Default',
            'description' => 'Extra all user data',
            'format' => 'sql',
            'source' => 'default',
        ],
    ],

    'source' => [
        'default' => [
            'connection' => 'mysql',
            'model' => User::class,
            'relationships' => [
                'mainProfile',
            ],
        ],
    ],
];
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Amirul Naim](https://github.com/naimsolong)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance60

Regular maintenance activity

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

5

Last Release

281d ago

Major Versions

0.0.3 → 1.0.02025-07-23

PHP version history (2 changes)0.0.1PHP ^8.2

1.0.1PHP ^8.2||^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6b83a3e8ad8dd97d316b503f7ec667b40c91425227d4276f23ed9915d397dc5?d=identicon)[naimsolong](/maintainers/naimsolong)

---

Top Contributors

[![naimsolong](https://avatars.githubusercontent.com/u/12205192?v=4)](https://github.com/naimsolong "naimsolong (58 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

data-extractorlaravellaravel-packagelaravelAmirul Naimdata-extractor

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/naimsolong-laravel-data-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/naimsolong-laravel-data-extractor/health.svg)](https://phpackages.com/packages/naimsolong-laravel-data-extractor)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
