PHP code example of shalior / filament-persian-date-field

1. Go to this page and download the library: Download shalior/filament-persian-date-field 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/ */

    

shalior / filament-persian-date-field example snippets


    protected function getFormSchema(): array
    {
        return [
            \Shalior\FilamentPersianDateField\Components\PersianDatePicker::make('persianDate')
            ->id('persian-date')
            ->maxDate(now()->format('Y-m-d'))
            ->minDate(now()->subWeek()->format('Y-m-d'))
            ->withoutTime()
            ->viewMode('month') // accepts 'day', 'month', 'year'
            ->default('2022-04-28'),
        ];
    }

    Shalior\FilamentPersianDateField\Columns::make('created_at')
        ->translateLabel()
        ->format('Y/m/d') // default is 'H:i:s Y/m/d'
        ->timeZone('Asia/Tehran'), // default is 'Asia/Tehran'
        // renders as: ۱۳۹۹/۰۸/۰۱ in the table
bash
php artisan vendor:publish --tag="filament-persian-date-field-config"