1. Go to this page and download the library: Download codicastudio/mega-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/ */
codicastudio / mega-filter example snippets
use DigitalCreative\MegaFilter\MegaFilter;
use DigitalCreative\MegaFilter\HasMegaFilterTrait;
use DigitalCreative\MegaFilter\Column;
class ExampleNovaResource extends Resource {
use HasMegaFilterTrait; // Important!!
public function cards(Request $request)
{
return [
MegaFilter::make([
'filters' => [
new DateOfBirthFilter(),
new UserTypeFilter()
],
'columns' => [
Column::make('Customer Name', 'name')->addFilter(new ActiveFilter()),
Column::make('Assets'),
Column::make('Payments')
]
])
];
}
}
use DigitalCreative\MegaFilter\Column;
use DigitalCreative\MegaFilter\HasMegaFilterTrait;
use DigitalCreative\MegaFilter\MegaFilter;
MegaFilter::make([
'columns' => [
Column::make($label),
Column::make($label, $attribute),
Column::make($label, $attribute, $filters),
new Column($label, $attribute, $filters),
],
])