PHPackages                             ilbronza/products - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ilbronza/products

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ilbronza/products
=================

:package\_description

0117PHP

Since Apr 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ilBronza/Products)[ Packagist](https://packagist.org/packages/ilbronza/products)[ RSS](/packages/ilbronza-products/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Products
========

[](#products)

Suppliers Creation from Standard Models
---------------------------------------

[](#suppliers-creation-from-standard-models)

This package now includes a helper feature that allows you to create **Suppliers** directly from existing Eloquent models.

### How it works

[](#how-it-works)

Any Eloquent model can be converted into a Supplier by invoking the SupplierCreatorHelper.
The system will automatically generate the corresponding Supplier entry, linking it to the source model through its class name and primary key.

### Example Usage

[](#example-usage)

### Notes

[](#notes)

- If a Supplier for the given model already exists, the factory will return it instead of creating a duplicate.
- The Supplier inherits descriptive fields from the model whenever possible.
- This feature is intended to simplify the integration of existing domain models into the Products package.

Sellables Creation from Standard Models
---------------------------------------

[](#sellables-creation-from-standard-models)

This package now includes a helper feature that allows you to create **Sellables** directly from existing Eloquent models.

### How it works

[](#how-it-works-1)

Any Eloquent model can be converted into a Sellable by invoking the SellableCreatorHelper.
The system will automatically generate the corresponding Sellable entry, linking it to the source model through its class name and primary key.

### Example Usage

[](#example-usage-1)

### Notes

[](#notes-1)

- If a Sellable for the given model already exists, the factory will return it instead of creating a duplicate.
- The Sellable inherits descriptive fields from the model whenever possible.
- This feature is intended to simplify the integration of existing domain models into the Products package.

### Sellable prices creation from Target Model

[](#sellable-prices-creation-from-target-model)

call this route

```
app('products')->route('products.calculatePrices')
```

it will execute ProductCalculatePricesController@calculatePrices

```
class ProductCalculatePricesController extends ProductCRUD
{
    public $allowedMethods = ['calculatePrices'];

    public function calculatePrices()
    {
        $products = $this->getModelClass()::all();

        foreach($products as $product)
            cache()->remember(
                $product->cacheKey('calculatePricesByTarget'),
                3600,
                function() use ($product)
                {
                    return SellablePricesCreatorHelper::calculatePricesByTarget($product);
                }
            );

        return response()->json([
            'status' => 'ok'
        ]);
    }
}
```

SellablePricesCreatorHelper::calculatePricesByTarget takes the product, call $product-&gt;getPriceBaseAttributes() and populate all sellable prices.

for example if you declare getPriceBaseAttributes like this:

```
namespace App\Overrides\Models\Products;

class Product extends IbProduct implements WithPriceInterface
{
	public function getPriceBaseAttributes()
	{
		return [
			'company_cost' => $this->company_cost,
			'client_price' => $this->client_price,
		];
	}
}
```

product sellables will have a company\_cost and a client\_price

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance60

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/33c65523e8a1cdfe8ed5f5fb8d90101b28eceb8c2ef7acb50a24cf6c42b8e639?d=identicon)[ilBronza](/maintainers/ilBronza)

---

Top Contributors

[![bronza](https://avatars.githubusercontent.com/u/3426331?v=4)](https://github.com/bronza "bronza (67 commits)")[![ilBronza](https://avatars.githubusercontent.com/u/68387610?v=4)](https://github.com/ilBronza "ilBronza (5 commits)")[![DatiSistema](https://avatars.githubusercontent.com/u/224988467?v=4)](https://github.com/DatiSistema "DatiSistema (3 commits)")

### Embed Badge

![Health badge](/badges/ilbronza-products/health.svg)

```
[![Health](https://phpackages.com/badges/ilbronza-products/health.svg)](https://phpackages.com/packages/ilbronza-products)
```

PHPackages © 2026

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