PHP code example of codewithdennis / filament-price-filter

1. Go to this page and download the library: Download codewithdennis/filament-price-filter 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/ */

    

codewithdennis / filament-price-filter example snippets




return [
    'currency' => 'USD',
    'cents' => true,
];

PriceFilter::make('price')
    ->currency(currency: 'EUR')

PriceFilter::make('price')
    ->currency(locale: 'NL'),

PriceFilter::make('price')
    ->currency(cents: false),

PriceFilter::make('price')
    ->slider()

PriceFilter::make('price')
    ->min(100)
    ->max(1000)

->min(fn () => Cache::flexible('min_price', [30, 60], function () {
    return Order::min('price') / 100; // Divide by 100 if you saved it as cents
}))

->max(fn () => Cache::flexible('max_price', [30, 60], function () {
    return Order::max('price') / 100; // Divide by 100 if you saved it as cents
}))

PriceFilter::make('price')
    ->step(100)

PriceFilter::make('price')
    ->label('Shipping price')
js
'./vendor/codewithdennis/filament-price-filter/resources/**/*.blade.php'