Files
online.tbbank.gov.tm-larave…/app/Modules/VisaMasterPaymentOrder/Nova/Resources/Concerns/VisaMasterPaymentOrderFieldsForIndex.php

67 lines
2.0 KiB
PHP

<?php
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use App\Nova\Resources\Branch\Branch;
use App\Repos\Order\OrderRepo;
use App\Repos\System\Settings\Location\RegionRepo;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
class VisaMasterPaymentOrderFieldsForIndex
{
/**
* Loan Order fields for "create"
*/
public static function make($resource): array
{
return [
ID::make()->hide(),
Text::make(__('ID'), 'unique_id')->sortable(),
Select::make(__('Ýüztutmanyň görnüşi'), 'type')
->fullWidth()
->searchable()
->rules('required')
->displayUsingLabels()
->options(VisaMasterPaymentOrder::applicationTypes()),
DateTime::make(__('Created at'), 'created_at')
->turkmenDateTime(),
Select::make(__('Region'), 'region')
->displayUsingLabels()
->options(RegionRepo::values())
->canSeeWhen('isAdmin', $resource)
->sortable(),
BelongsTo::make(__('Branch'), 'branch', Branch::class)
->canSeeWhen('isAdmin', $resource)
->filterable()
->sortable(),
Text::make(__('Name'), 'passport_name'),
Text::make(__('Surname'), 'passport_surname'),
Text::make(__('Phone'), 'phone'),
Badge::make(__('Status'), 'status')
->map(OrderRepo::statusClasses())
->addTypes([
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
])
->labels(OrderRepo::statusValues())
->withIcons()
->icons(OrderRepo::statusIcons())
->sortable(),
];
}
}