PHP code example of vyuldashev / nova-column-filter
1. Go to this page and download the library: Download vyuldashev/nova-column-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/ */
vyuldashev / nova-column-filter example snippets
declare(strict_types=1);
namespace App\Nova\Filters;
use Vyuldashev\NovaColumnFilter\ColumnFilter;
class EmailFilter extends ColumnFilter
{
public $name = 'Email';
public $column = 'email';
}
declare(strict_types=1);
namespace App\Nova\Filters;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Laravel\Nova\Filters\DateFilter;
class CreatedAtFromFilter extends DateFilter
{
public $name = 'Created at from';
public function apply(Request $request, $query, $value): object
{
$value = Carbon::parse($value);
return $query->where('created_at', '>=', $value->startOfDay());
}
}