Laon orders wip
This commit is contained in:
1 parent
7ed3ae41f0
commit
298bec116a
3 files changed
+36
-30
No files matched your search
@@ -58,14 +58,10 @@ public static function make(): array
|
||||
]),
|
||||
|
||||
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'),
|
||||
Text::make(
|
||||
__('Full Name'),
|
||||
fn ($model) => sprintf('%s %s %s', $model->customer_name, $model->customer_surname, $model->customer_patronic_name)
|
||||
),
|
||||
|
||||
Select::make(__('Education'), 'education')
|
||||
->displayUsingLabels()
|
||||
@@ -78,7 +74,8 @@ public static function make(): array
|
||||
->size('w-1/3'),
|
||||
|
||||
Date::make(__('Date of birth'), 'born_at')
|
||||
->size('w-1/3'),
|
||||
->size('w-1/3')
|
||||
->toTurkmenFormat(),
|
||||
|
||||
Text::make(__('Residence (passport)'), 'passport_address')
|
||||
->size('w-1/2'),
|
||||
@@ -87,25 +84,6 @@ public static function make(): array
|
||||
->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'),
|
||||
@@ -148,10 +126,24 @@ public static function make(): array
|
||||
->size('w-1/4'),
|
||||
|
||||
Date::make(__('Work started at'), 'work_started_at')
|
||||
->size('w-1/4'),
|
||||
->size('w-1/4')
|
||||
->toTurkmenFormat(),
|
||||
]),
|
||||
|
||||
new Panel(__('Passport'), [
|
||||
Text::make(__('Passport'), fn ($model) => sprintf(
|
||||
'%s %s, %sý',
|
||||
$model->passport_serie,
|
||||
$model->passport_id,
|
||||
$model->passport_given_at?->format('d.m.Y')
|
||||
)),
|
||||
|
||||
Text::make(__('Passport given by'), 'passport_given_by')
|
||||
->size('w-1/2'),
|
||||
|
||||
Text::make(__('Born place (passport)'), 'born_place')
|
||||
->size('w-1/2'),
|
||||
|
||||
Image::make(__('Passport (page 1)'), 'passport_one')
|
||||
->size('w-1/2'),
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Nova\Events\ServingNova;
|
||||
use Laravel\Nova\Fields\Date;
|
||||
use Laravel\Nova\Fields\Field;
|
||||
use Laravel\Nova\Menu\Menu;
|
||||
use Laravel\Nova\Menu\MenuGroup;
|
||||
use Laravel\Nova\Menu\MenuItem;
|
||||
@@ -39,6 +41,7 @@ public function boot(): void
|
||||
$this->setupUserNavigation();
|
||||
$this->setupUserSettings();
|
||||
$this->setupAssets();
|
||||
$this->setupFieldMacros();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,4 +160,14 @@ public function setupAssets(): void
|
||||
{
|
||||
Nova::style('additional', resource_path('css/vendor/nova/css/additional.css'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup macros of fields
|
||||
*/
|
||||
public function setupFieldMacros(): void
|
||||
{
|
||||
Date::macro('toTurkmenFormat', function () {
|
||||
return $this->displayUsing(fn ($value) => $value?->format('d.m.Y'));
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user