dpsoft/nova-persian-date-filter

A Laravel Nova filter.

v1.0 2020-02-16 11:43 UTC

This package is auto-updated.

Last update: 2024-10-29 05:53:18 UTC


README

Latest Version on Packagist Total Downloads

screenshot 1

With this package you can use persian date filter in nova.

Installation

Install package via composer:

composer require dpsoft/nova-persian-date-filter

The package will automatically register itself.

Usage

Extend Dpsoft\NovaPersiandateFilter\PersianDateFilter and in apply method parse value with Carbon and use in query:

<?php

namespace App\Nova\Filters;

use Dpsoft\NovaPersiandateFilter\PersianDateFilter;
...

class InvoicesFrom extends PersianDateFilter
{
    public function apply(Request $request, $query, $value)
    {
        $value = Carbon::parse($value)->startOfDay();

        return $query->where('created_at', ">=", $value);
    }
}

Security

If you discover any security related issues, please email sadeghpm@gmail.com instead of using the issue tracker.

Credits