PHPackages                             whitecube/laravel-prices - 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. whitecube/laravel-prices

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

whitecube/laravel-prices
========================

Manage acquisition, selling &amp; renting prices for products and services in your Laravel Application

v1.6.0(8mo ago)121.6k↓13.3%3[1 issues](https://github.com/whitecube/laravel-prices/issues)PHPCI passing

Since Jan 17Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/whitecube/laravel-prices)[ Packagist](https://packagist.org/packages/whitecube/laravel-prices)[ RSS](/packages/whitecube-laravel-prices/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (17)Used By (0)

laravel-prices
==============

[](#laravel-prices)

Manage acquisition, selling &amp; renting prices for products and services in your Laravel Application

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

[](#installation)

```
composer require whitecube/laravel-prices
```

Configuration
-------------

[](#configuration)

You can publish the config file by running this command:

```
php artisan vendor:publish --tag=prices-config
```

Once your configuration file is created in `config/prices.php`, you can edit the Price model to a custom Price model by changing:

```
return [
    'model' => \App\Models\CustomPriceModel::class,
];
```

Quick overview
--------------

[](#quick-overview)

This package lets you attach prices to anything you want, and keeps a history of the price changes overtime.

To achieve that, the package will migrate a `prices` table which is used to store every price change that occurs on your priceable items *(such as products or services)*. When you access your item's price, the most recent result in that table will be returned.

This documentation will use a fake `Product` model as an example, however you can link these prices to anything you want.

Usage
-----

[](#usage)

Add the `HasPrices` trait to your Product model.

```
