PHPackages                             astra-techno/data-forge - 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. [Database &amp; ORM](/categories/database)
4. /
5. astra-techno/data-forge

ActiveLibrary[Database &amp; ORM](/categories/database)

astra-techno/data-forge
=======================

A Laravel package for creating modular SQL, Entity, and Task-based backends.

v1.5.1(1y ago)182MITPHPPHP ^8.0

Since Jan 5Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/Astra-Techno/DataForge)[ Packagist](https://packagist.org/packages/astra-techno/data-forge)[ RSS](/packages/astra-techno-data-forge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

DataForge
=========

[](#dataforge)

[![Latest Stable Version](https://camo.githubusercontent.com/430be87529bbea2549aefae8862e87116b1064d53accb5fd49aa0b7cc3293c27/68747470733a2f2f706f7365722e707567782e6f72672f61737472612d746563686e6f2f646174612d666f7267652f762f737461626c65)](https://packagist.org/packages/astra-techno/data-forge)[![License](https://camo.githubusercontent.com/b9259aac8ae714d322da3c7d8771335ca10b63001180e52ff5c7eef34f8b14e7/68747470733a2f2f706f7365722e707567782e6f72672f61737472612d746563686e6f2f646174612d666f7267652f6c6963656e7365)](https://packagist.org/packages/astra-techno/data-forge)

**DataForge** is a robust Laravel-based framework designed to streamline SQL query management, entity-based data handling, and modular task workflows. It helps developers build scalable, maintainable, and high-performance backend solutions for web applications.

---

Key Features
------------

[](#key-features)

- **Dynamic SQL Query Builder**: Write clean and reusable SQL queries using innovative features like `filterOptional` and `filterAnyOneRequired`.
- **Entity Management**: Encapsulate business logic with lazy-loading, inter-entity connectivity, and attribute grouping.
- **Modular Task Workflows**: Handle complex backend logic with reusable task classes.
- **Prebuilt API Endpoints**: Ready-to-use endpoints for fetching lists, single items, field values, and more.
- **Scalability &amp; Flexibility**: Perfect for applications ranging from startups to enterprise-grade systems.

---

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

[](#installation)

Install the package via Composer:

```
composer require astra-techno/data-forge
```

---

Getting Started
---------------

[](#getting-started)

### 1. Publish Configuration and Setup

[](#1-publish-configuration-and-setup)

After installation, publish the configuration file and setup the directory structure:

```
php artisan vendor:publish --provider="AstraTech\DataForge\DataForgeServiceProvider"
```

This will create the `app/DataForge` directory, which includes `Sql`, `Entity`, and `Task` subdirectories.

---

### 2. Create a SQL Class

[](#2-create-a-sql-class)

Define your SQL queries in a dedicated class:

```
namespace App\DataForge\Sql;

class Product extends \DataForge\Sql
{
    public function list(&$data)
    {
        $query = Query('ProductList');
        $query->select('list', 'p.id, p.name, p.price, p.stock, c.name AS category');
        $query->from('products AS p');
        $query->inner('categories AS c ON p.category_id = c.id');
        $query->filterOptional('p.name LIKE {%request.keyword%}');
        $query->group('p.id');
        $query->order('{request.sort}', '{request.order}');
        return $query;
    }
}
```

---

### 3. Create an Entity Class

[](#3-create-an-entity-class)

Define the business logic for your module:

```
namespace App\DataForge\Entity;

class Product
{
    use \DataForge\Entity;

    function init($id)
    {
        return \Sql('Product:list', ['id' => $id, 'select' => 'entity'])->fetchRow();
    }

    function getCategory()
    {
        return \DataForge::getCategory($this->category_id);
    }
}
```

---

### 4. Use API Endpoints

[](#4-use-api-endpoints)

Leverage prebuilt endpoints for data retrieval and task execution:

- **Fetch a list of products**:

    ```
    GET /api/list/Product:list?keyword=shoes&pageNo=1&limit=10
    ```
- **Retrieve a product entity**:

    ```
    GET /api/entity/Product/1
    ```
- **Execute a task**:

    ```
    POST /api/Task/ProductTask/detail
    ```

---

Documentation
-------------

[](#documentation)

Explore the full documentation, examples, and demo at: 🌐 **[DataForge Documentation](https://data-forge.tech)**

---

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

[](#contributing)

We welcome contributions to improve DataForge. Follow these steps to contribute:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Commit your changes and push to your fork.
4. Submit a pull request.

---

License
-------

[](#license)

DataForge is open-source software licensed under the **MIT License**. See the [LICENSE](LICENSE) file for more details.

---

Connect with Us
---------------

[](#connect-with-us)

- **Official Site**: [data-forge.tech](https://data-forge.tech)
- **LinkedIn**: Follow Us
- **Twitter**: @DataForgeTech

---

Support
-------

[](#support)

If you encounter any issues or have questions, feel free to reach out through the [GitHub Issues](https://github.com/Astra-Techno/DataForge/issues) or our support page.

---

**Build powerful backends with DataForge!**

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance49

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~11 days

Total

6

Last Release

441d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fabce60dd9e6688c9a2db4ecc2ea7fce239eec67b0d309a34e0277ba2c739a6f?d=identicon)[Astra-Techno](/maintainers/Astra-Techno)

---

Top Contributors

[![Astra-Techno](https://avatars.githubusercontent.com/u/193468736?v=4)](https://github.com/Astra-Techno "Astra-Techno (10 commits)")[![mathavan1novo](https://avatars.githubusercontent.com/u/171063666?v=4)](https://github.com/mathavan1novo "mathavan1novo (5 commits)")

### Embed Badge

![Health badge](/badges/astra-techno-data-forge/health.svg)

```
[![Health](https://phpackages.com/badges/astra-techno-data-forge/health.svg)](https://phpackages.com/packages/astra-techno-data-forge)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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