PHP code example of optimistdigital / nova-currency-vat-field
1. Go to this page and download the library: Download optimistdigital/nova-currency-vat-field library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
optimistdigital / nova-currency-vat-field example snippets
use Outl1ne\NovaCurrencyVatField\CurrencyVAT;
public function fields(Request $request) {
CurrencyVAT::make('Price', 'price')
->VAT(20) // Required, otherwise VAT checkbox isn't rendered
->storedWithVAT() // By default with VAT
->storedWithoutVAT()
}
use Brick\Money\Context\CustomContext;
CurrencyVAT::make('Price', 'price')
->VAT(24)
->storedWithoutVAT()
->displayedWithVAT()
->storedDecimals(4) // Decimals of the stored price, defaults to the currency's
->context(new CustomContext(4)) // Required by Nova to format a 4 decimal value on Index and Detail views