94 lines
3.0 KiB
PHP
94 lines
3.0 KiB
PHP
<?php
|
|
|
|
namespace App\Nova\Resources\Order\Card\Requisite\Concerns;
|
|
|
|
use App\Nova\Resources\Branch\Branch;
|
|
use App\Nova\Resources\Order\Card\CardType;
|
|
use App\Nova\User;
|
|
use App\Repos\Order\OrderRepo;
|
|
use App\Repos\System\Settings\Legal\PassportRepo;
|
|
use App\Repos\System\Settings\Location\RegionRepo;
|
|
use Laravel\Nova\Fields\Badge;
|
|
use Laravel\Nova\Fields\BelongsTo;
|
|
use Laravel\Nova\Fields\Date;
|
|
use Laravel\Nova\Fields\ID;
|
|
use Laravel\Nova\Fields\Image;
|
|
use Laravel\Nova\Fields\Number;
|
|
use Laravel\Nova\Fields\Select;
|
|
use Laravel\Nova\Fields\Text;
|
|
use Laravel\Nova\Panel;
|
|
use Nurmuhammet\NovaInputmask\NovaInputmask;
|
|
|
|
class CardRequisiteFieldsForDetail
|
|
{
|
|
|
|
public static function make(): array
|
|
{
|
|
return [
|
|
ID::make()->hide(),
|
|
Text::make(__('ID'), 'unique_id'),
|
|
|
|
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()),
|
|
|
|
Text::make(__('Note'), 'notes'),
|
|
|
|
BelongsTo::make(__('Created by').': ', 'user', User::class),
|
|
|
|
new Panel(__('Card'), [
|
|
BelongsTo::make(__('Card type'), 'cardType', CardType::class),
|
|
|
|
NovaInputmask::make(__('Card number'), 'card_number')
|
|
->mask('9999 9999 9999 9999')
|
|
->storeRawValue(),
|
|
]),
|
|
|
|
new Panel(__('Location'), [
|
|
Select::make(__('Region'), 'region')
|
|
->displayUsingLabels()
|
|
->options(RegionRepo::values()),
|
|
|
|
BelongsTo::make(__('Branch'), 'branch', Branch::class),
|
|
]),
|
|
|
|
new Panel(__('Personal data'), [
|
|
Text::make(
|
|
__('Full Name'),
|
|
fn ($model) => sprintf(
|
|
'%s %s %s',
|
|
$model->customer_name,
|
|
$model->customer_surname,
|
|
$model->customer_patronic_name
|
|
)
|
|
),
|
|
|
|
Date::make(__('Date of birth'), 'born_at')
|
|
->toTurkmenFormat(),
|
|
|
|
NovaInputmask::make(__('Phone'), 'phone')
|
|
->mask('+(\\9\\93)-99-99-99-99')
|
|
->storeRawValue(),
|
|
]),
|
|
|
|
new Panel(__('Passport'), [
|
|
Select::make(__('Passport serie'), 'passport_serie')
|
|
->displayUsingLabels()
|
|
->options(PassportRepo::values()),
|
|
|
|
Number::make(__('Passport id'), 'passport_id'),
|
|
|
|
Image::make(__('Passport (page 1)'), 'passport_one'),
|
|
Image::make(__('Passport (page 2-3)'), 'passport_two'),
|
|
Image::make(__('Passport (page 8-9)'), 'passport_three'),
|
|
Image::make(__('Passport (page 32)'), 'passport_four'),
|
|
]),
|
|
];
|
|
}
|
|
}
|