Modify translations & fix detail page for loan orders
This commit is contained in:
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
namespace App\Nova\Resources\Order\Loan\Concerns;
|
||||
|
||||
use App\Nova\Resources\Branch\Branch;
|
||||
use App\Nova\Resources\System\Location\Province;
|
||||
use App\Repos\Order\Loan\LoanTypeRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\System\Settings\Legal\EducationRepo;
|
||||
use App\Repos\System\Settings\Legal\MarriageRepo;
|
||||
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\Email;
|
||||
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 LoanOrderFieldsForDetail
|
||||
{
|
||||
/**
|
||||
* Loan order fields for detail
|
||||
*/
|
||||
public static function make(): array
|
||||
{
|
||||
return [
|
||||
ID::make()->sortable(),
|
||||
|
||||
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()),
|
||||
|
||||
new Panel(__('Loan'), [
|
||||
Select::make(__('Loan type'), 'loan_type')
|
||||
->displayUsingLabels()
|
||||
->fullWidth()
|
||||
->options(LoanTypeRepo::values()),
|
||||
]),
|
||||
|
||||
new Panel(__('Location'), [
|
||||
Select::make(__('Region'), 'region')
|
||||
->displayUsingLabels()
|
||||
->options(RegionRepo::values())
|
||||
->size('w-1/2'),
|
||||
|
||||
BelongsTo::make(__('Branch'), 'branch', Branch::class),
|
||||
]),
|
||||
|
||||
new Panel(__('Personal data'), [
|
||||
Text::make(__('Name'), 'customer_name')
|
||||
->size('w-1/3'),
|
||||
|
||||
Text::make(__('Surname'), 'customer_surname')
|
||||
->size('w-1/3'),
|
||||
|
||||
Text::make(__('Patronic name'), 'customer_patronic_name')
|
||||
->size('w-1/3'),
|
||||
|
||||
Select::make(__('Education'), 'education')
|
||||
->displayUsingLabels()
|
||||
->options(EducationRepo::values())
|
||||
->size('w-1/3'),
|
||||
|
||||
Select::make(__('Marriage status'), 'marriage_status')
|
||||
->displayUsingLabels()
|
||||
->options(MarriageRepo::values())
|
||||
->size('w-1/3'),
|
||||
|
||||
Date::make(__('Date of birth'), 'born_at')
|
||||
->size('w-1/3'),
|
||||
|
||||
Text::make(__('Residence (passport)'), 'passport_address')
|
||||
->size('w-1/2'),
|
||||
|
||||
Text::make(__('Current Residence'), 'real_address')
|
||||
->size('w-1/2'),
|
||||
]),
|
||||
|
||||
new Panel(__('Passport'), [
|
||||
Select::make(__('Passport serie'), 'passport_serie')
|
||||
->displayUsingLabels()
|
||||
->options(PassportRepo::values())
|
||||
->size('w-1/3'),
|
||||
|
||||
Number::make(__('Passport id'), 'passport_id')
|
||||
->size('w-1/3'),
|
||||
|
||||
Date::make(__('Passport date of issue'), 'passport_given_at')
|
||||
->size('w-1/3'),
|
||||
|
||||
Text::make(__('Passport given by'), 'passport_given_by')
|
||||
->size('w-1/2'),
|
||||
|
||||
Text::make(__('Born place (passport)'), 'born_place')
|
||||
->size('w-1/2'),
|
||||
]),
|
||||
|
||||
new Panel(__('Contact data'), [
|
||||
Email::make(__('Email'), 'email')
|
||||
->size('w-1/4'),
|
||||
|
||||
NovaInputmask::make(__('Phone'), 'phone')
|
||||
->mask('+(\\9\\93)-99-99-99-99')
|
||||
->storeRawValue()
|
||||
->size('w-1/4'),
|
||||
|
||||
NovaInputmask::make(__('Phone Additional'), 'phone_additional')
|
||||
->mask('+(\\9\\93)-99-99-99-99')
|
||||
->storeRawValue()
|
||||
->size('w-1/4'),
|
||||
|
||||
NovaInputmask::make(__('Home phone'), 'phone_home')
|
||||
->mask('+(\\9\\93)-9{8}')
|
||||
->storeRawValue()
|
||||
->size('w-1/4'),
|
||||
]),
|
||||
|
||||
new Panel(__('Job'), [
|
||||
Text::make(__('Work company name'), 'work_company')
|
||||
->size('w-1/2'),
|
||||
|
||||
NovaInputmask::make(__('HR department work number'), 'work_company_accountant_number')
|
||||
->mask('+(\\9\\93)-9{8}')
|
||||
->size('w-1/2'),
|
||||
|
||||
Select::make(__('Work region'), 'work_region')
|
||||
->displayUsingLabels()
|
||||
->options(RegionRepo::values())
|
||||
->size('w-1/2'),
|
||||
|
||||
BelongsTo::make(__('Work province'), 'workProvince', Province::class),
|
||||
|
||||
Text::make(__('Position'), 'work_position')
|
||||
->size('w-1/2'),
|
||||
|
||||
Text::make(__('Salary'), 'work_salary')
|
||||
->size('w-1/4'),
|
||||
|
||||
Date::make(__('Work started at'), 'work_started_at')
|
||||
->size('w-1/4'),
|
||||
]),
|
||||
|
||||
new Panel(__('Passport'), [
|
||||
Image::make(__('Passport (page 1)'), 'passport_one')
|
||||
->size('w-1/2'),
|
||||
|
||||
Image::make(__('Passport (page 2-3)'), 'passport_two')
|
||||
->size('w-1/2'),
|
||||
|
||||
Image::make(__('Passport (page 8-9)'), 'passport_three')
|
||||
->size('w-1/2'),
|
||||
|
||||
Image::make(__('Passport (page 32)'), 'passport_four')
|
||||
->size('w-1/2'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ use App\Models\Order\Loan\LoanOrder as LoanOrderModel;
|
||||
use App\Models\System\Location\Province;
|
||||
use App\Nova\Resource;
|
||||
use App\Nova\Resources\Order\Loan\Concerns\LoanOrderEvents;
|
||||
use App\Nova\Resources\Order\Loan\Concerns\LoanOrderFieldsForDetail;
|
||||
use App\Nova\Resources\Order\Loan\Concerns\LoanOrderFieldsForIndex;
|
||||
use App\Repos\Order\Loan\LoanTypeRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
@@ -102,6 +103,14 @@ class LoanOrder extends Resource
|
||||
return LoanOrderFieldsForIndex::make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields for detail
|
||||
*/
|
||||
public function fieldsForDetail(): array
|
||||
{
|
||||
return LoanOrderFieldsForDetail::make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields displayed by the resource.
|
||||
*/
|
||||
@@ -271,7 +280,7 @@ class LoanOrder extends Resource
|
||||
->rules('required')
|
||||
->sortable(),
|
||||
|
||||
Select::make(__('Work province'), 'work_province')
|
||||
Select::make(__('Work province'), 'work_province_id')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->dependsOn('work_region', NovaRepo::dependsOnRegion('work_region', Province::class))
|
||||
@@ -308,9 +317,6 @@ class LoanOrder extends Resource
|
||||
->size('w-1/2')
|
||||
->rules('required', 'max:2048'),
|
||||
]),
|
||||
|
||||
// $table->foreignId('filled_by')->constrained('users')->restrictOnDelete();
|
||||
// $table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user