PHP code example of nemrutco / nova-filterable-metrics
1. Go to this page and download the library: Download nemrutco/nova-filterable-metrics 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/ */
nemrutco / nova-filterable-metrics example snippets
// in your Nova value metric card class:
use Nemrutco\Filterable\FilterableValue;
use FilterableValue;
// in your filterable Nova metric:
use App\Nova\Filters\Date;
use App\Nova\Filters\Store;
public function filters()
{
return [
new Store,
new Date,
];
}
public function range()
{
return $this->withMeta(['mode' => 'range']);
}
public function filters(Request $request)
{
return [
(new Date)->range(),
]
}