PHPackages                             wamesk/laravel-nova-price-field - 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. wamesk/laravel-nova-price-field

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

wamesk/laravel-nova-price-field
===============================

A Laravel Nova price field with moneyphp/money library.

1.5.0(3w ago)0230MITPHPPHP ^8.1

Since Feb 27Pushed 3w ago1 watchersCompare

[ Source](https://github.com/wamesk/laravel-nova-price-field)[ Packagist](https://packagist.org/packages/wamesk/laravel-nova-price-field)[ RSS](/packages/wamesk-laravel-nova-price-field/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (15)Used By (0)

Laravel Nova Price Field
========================

[](#laravel-nova-price-field)

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

[](#installation)

```
composer require wamesk/laravel-nova-price-field
```

Casts
-----

[](#casts)

This package provides two Eloquent casts for storing prices as integers (cents).

### PriceCast

[](#pricecast)

Full-featured cast with tax support. Use when the model has tax logic (`withTax`, `withoutTax`, `taxAmount`, etc.).

```
use Wame\LaravelNovaPriceField\Casts\PriceCast;

protected function casts(): array
{
    return [
        'price' => PriceCast::class,
    ];
}
```

**Available methods on the cast value:**

MethodDescription`asFloat()`Price as float (cents ÷ 100)`asMoney()``Money` object`formatted()`Formatted string (e.g. `1 234,50 EUR`)`withTax($formatted)``Money` object or formatted string`withoutTax($formatted)``Money` object or formatted string (requires tax config)`tax($formatted)`Tax rate as int or formatted string`taxAmount($formatted)`Tax amount as `Money` or formatted string`totalWithTax($formatted)`Total incl. tax × quantity`totalWithoutTax($formatted)`Total excl. tax × quantity`totalTaxAmount($formatted)`Total tax amount × quantity**Optional model static properties:**

```
// Automatically reads price_without_tax column
public static string|bool $priceWithoutTaxColumn = true;

// Custom tax column (default: 'tax')
public static string $taxColumn = 'vat';

// Custom quantity column (default: 'quantity')
public static string $quantityColumn = 'qty';

// Custom currency column
public static string $currencyColumn = 'currency_code';
```

### SimplePriceCast

[](#simplepricecast)

Lightweight cast without any tax logic. Use for cost fields, budgets, or any price stored without VAT context.

```
use Wame\LaravelNovaPriceField\Casts\SimplePriceCast;

protected function casts(): array
{
    return [
        'planned_cost' => SimplePriceCast::class,
        'actual_cost'  => SimplePriceCast::class,
    ];
}
```

**Available methods on the cast value:**

MethodDescription`asFloat()`Price as float (cents ÷ 100)`asMoney()``Money` object`formatted()`Formatted string (e.g. `1 234,50 EUR`)Both casts share the same base class (`AbstractPriceCast`) and resolve the currency from the model's `currency`, `currency_id`, or `$currencyColumn` property (defaulting to `EUR`).

---

Nova Field
----------

[](#nova-field)

### Auto-detection of cast type

[](#auto-detection-of-cast-type)

The `Price` field automatically detects which cast is used on the model attribute and adjusts its behaviour accordingly — no manual configuration needed.

CastBehaviour`PriceCast`Full tax UI: shows `withTax`, `withoutTax`, tax amount, tax percentage`SimplePriceCast`Tax UI disabled automatically; shows only the formatted priceIf `->withAllFieldOnForm()` is called on a field backed by `SimplePriceCast`, the tax input sub-fields are suppressed automatically (the `with_all_field_on_form` meta is overridden to `false` at resolve time).

```
// PriceCast — full tax fields shown automatically
Price::make('Price', 'price'),

// SimplePriceCast — tax fields hidden automatically, even with withAllFieldOnForm()
Price::make('Planned cost', 'planned_cost'),
```

Shows a single input for price. When viewing on detail or index, shows price with currency suffix.

```
use Wame\LaravelNovaPriceField\Fields\Price;

Price::make('price'),
```

### Showing total price

[](#showing-total-price)

```
Price::make('price')
    ->asTotal(),
```

Usage should be only for viewing (detail and index page).

### Multiple fields on form

[](#multiple-fields-on-form)

Adds price without tax and tax input with automatic calculation. Saves only price with tax.

```
Price::make()
    ->withAllFieldOnForm()
```

With custom column names:

```
Price::make()
    ->withAllFieldOnForm(withoutTaxColumn: 'price_without_tax', taxColumn: 'tax')
```

### Using price inputs without tax input

[](#using-price-inputs-without-tax-input)

```
Price::make()
    ->withAllFieldOnForm()
    ->hideTaxFormField()
    ->setTax(23)
```

### Using predefined tax options

[](#using-predefined-tax-options)

```
Price::make()
    ->withAllFieldOnForm()
    ->taxFieldAsSelect([
        10 => ['name' => 'Reduced tax (10%)'],
        23 => ['name' => 'Standard tax (23%)'],
    ])
```

Save the selected option ID:

```
Price::make()
    ->withAllFieldOnForm()
    ->taxFieldAsSelect([
        10 => ['id' => 'reduced',  'name' => 'Reduced tax (10%)'],
        23 => ['id' => 'standard', 'name' => 'Standard tax (23%)'],
    ], 'vat_rate_type')
```

Save the option value (key) instead of ID:

```
Price::make()
    ->withAllFieldOnForm()
    ->taxFieldAsSelect([
        10 => ['id' => 'reduced',  'name' => 'Reduced tax (10%)'],
        23 => ['id' => 'standard', 'name' => 'Standard tax (23%)'],
    ], 'vat_rate_type', true)
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.6% 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 ~36 days

Recently: every ~73 days

Total

14

Last Release

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bf6ece61ae07942df38ce88eb4053d4176c6ab0bf803191953961023f25fc70?d=identicon)[WAME](/maintainers/WAME)

---

Top Contributors

[![adrianzofcin](https://avatars.githubusercontent.com/u/75702986?v=4)](https://github.com/adrianzofcin "adrianzofcin (23 commits)")[![stanislav-cervenak](https://avatars.githubusercontent.com/u/6931349?v=4)](https://github.com/stanislav-cervenak "stanislav-cervenak (7 commits)")[![wamesro](https://avatars.githubusercontent.com/u/5340873?v=4)](https://github.com/wamesro "wamesro (4 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/wamesk-laravel-nova-price-field/health.svg)

```
[![Health](https://phpackages.com/badges/wamesk-laravel-nova-price-field/health.svg)](https://phpackages.com/packages/wamesk-laravel-nova-price-field)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3453.7M8](/packages/optimistdigital-nova-multiselect-field)[vyuldashev/nova-money-field

A Laravel Nova field for Money.

73814.0k1](/packages/vyuldashev-nova-money-field)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

52178.7k1](/packages/inspheric-nova-defaultable)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11273.0k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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