From b46dad2183aa83214bf24b6a7a35f9c46b89e982 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Sun, 8 Sep 2024 19:17:34 +0500 Subject: [PATCH] wip on mfs --- .../VisaMasterPaymentOrderFieldsForDetail.php | 154 ++++++++++++++++++ .../Resources/NovaVisaMasterPaymentOrder.php | 9 + composer.lock | 30 ++-- lang/tk.json | 3 +- resources/views/vendor/nova/layout.blade.php | 11 ++ 5 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 app/Modules/VisaMasterPaymentOrder/Nova/Resources/Concerns/VisaMasterPaymentOrderFieldsForDetail.php diff --git a/app/Modules/VisaMasterPaymentOrder/Nova/Resources/Concerns/VisaMasterPaymentOrderFieldsForDetail.php b/app/Modules/VisaMasterPaymentOrder/Nova/Resources/Concerns/VisaMasterPaymentOrderFieldsForDetail.php new file mode 100644 index 0000000..3ab934c --- /dev/null +++ b/app/Modules/VisaMasterPaymentOrder/Nova/Resources/Concerns/VisaMasterPaymentOrderFieldsForDetail.php @@ -0,0 +1,154 @@ +hideFromDetail(), + + Hidden::make('user_id') + ->default(auth()->id()) + ->hideWhenUpdating(), + + Text::make(__('ID'), 'unique_id') + ->exceptOnForms(), + + Select::make(__('Status'), 'status') + ->displayUsingLabels() + ->searchable() + ->options(OrderRepo::statusValues()) + ->default(OrderRepo::defaultStatus()) + ->fullWidth() + ->hideFromDetail() + ->rules('required') + ->canSeeWhen('systemUser', $resource), + + 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') + ->fullWidth() + ->canSeeWhen('systemUser', $resource), + ]), + new Panel(__('Application type'), [ + Select::make(__('Application type'), 'type') + ->fullWidth() + ->searchable() + ->rules('required') + ->displayUsingLabels() + ->options(VisaMasterPaymentOrder::applicationTypes()), + ]), + new Panel(__('Location'), [ + Select::make(__('Region'), 'region') + ->fullWidth() + ->displayUsingLabels() + ->searchable() + ->options(RegionRepo::values()) + ->default(RegionRepo::default()) + ->rules('required') + ->sortable(), + + BelongsTo::make(__('Branch'), 'branch', Branch::class), + ]), + new Panel(__('Personal data'), [ + Text::make(__('Passport name'), 'passport_name') + ->fullWidth() + ->rules('required', 'string', 'max:255'), + + Text::make(__('Passport surname'), 'passport_surname') + ->fullWidth() + ->rules('required', 'string', 'max:255'), + + NovaInputmask::make(__('Phone'), 'phone') + ->fullWidth() + ->phonenumber('TM') + ->rules('required', 'max:255') + ->hideFromIndex(), + + Text::make(__('Email'), 'email') + ->fullWidth() + ->rules('nullable', 'max:255', 'email') + ->hideFromIndex(), + + Text::make(__('Current Residence'), 'address') + ->fullWidth() + ->rules('required', 'string', 'max:255') + ->hideFromIndex(), + ]), + new Panel(__('Payment'), [ + SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [ + Select::make(__('Passport serie'), 'passport_serie') + ->displayUsingLabels() + ->searchable() + ->options(PassportRepo::values()) + ->rules('required') + ->sortable(), + + NovaInputmask::make(__('Passport number'), 'passport_number') + ->mask('999999') + ->rules('required', 'max:255'), + + Text::make( + name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')), + attribute: 'full_name' + ) + ->rules('required', 'max:255'), + ])->minRows(1)->rules('required'), + + SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [ + Select::make(__('Passport serie'), 'passport_serie') + ->displayUsingLabels() + ->searchable() + ->options(PassportRepo::values()) + ->rules('required') + ->sortable(), + + NovaInputmask::make(__('Passport number'), 'passport_number') + ->mask('999999') + ->rules('required', 'max:255'), + + Text::make( + name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')), + attribute: 'full_name' + )->rules('required', 'max:255'), + ])->maxRows(1)->minRows(1)->rules('required'), + ]), + + new Panel(__('Reciver files'), VisaMasterPaymentOrderFileFields::reciverFiles()), + new Panel(__('Sender files'), VisaMasterPaymentOrderFileFields::senderFiles()), + ]; + } +} diff --git a/app/Modules/VisaMasterPaymentOrder/Nova/Resources/NovaVisaMasterPaymentOrder.php b/app/Modules/VisaMasterPaymentOrder/Nova/Resources/NovaVisaMasterPaymentOrder.php index a438b47..079bc58 100644 --- a/app/Modules/VisaMasterPaymentOrder/Nova/Resources/NovaVisaMasterPaymentOrder.php +++ b/app/Modules/VisaMasterPaymentOrder/Nova/Resources/NovaVisaMasterPaymentOrder.php @@ -4,6 +4,7 @@ namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources; use App\Models\Branch\Branch; use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder; +use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForDetail; use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForIndex; use App\Nova\Resource; use App\Repos\Order\Card\CardOrderRepo; @@ -102,6 +103,14 @@ class NovaVisaMasterPaymentOrder extends Resource return VisaMasterPaymentOrderFieldsForIndex::make($this); } + /** + * Get the fields for detail + */ + public function fieldsForDetail(): array + { + return VisaMasterPaymentOrderFieldsForDetail::make($this); + } + /** * Get the fields displayed by the resource. * diff --git a/composer.lock b/composer.lock index 8751c4e..9b773e9 100644 --- a/composer.lock +++ b/composer.lock @@ -1355,12 +1355,12 @@ "source": { "type": "git", "url": "https://github.com/nurmuhammet-ali/nova-tabs.git", - "reference": "d706ee1fe66f6ee9fc0584c0e06ab47e41b03990" + "reference": "becb4fdf1b187e6726e7def5701b5747a66bbf8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nurmuhammet-ali/nova-tabs/zipball/d706ee1fe66f6ee9fc0584c0e06ab47e41b03990", - "reference": "d706ee1fe66f6ee9fc0584c0e06ab47e41b03990", + "url": "https://api.github.com/repos/nurmuhammet-ali/nova-tabs/zipball/becb4fdf1b187e6726e7def5701b5747a66bbf8d", + "reference": "becb4fdf1b187e6726e7def5701b5747a66bbf8d", "shasum": "" }, "require": { @@ -1419,7 +1419,7 @@ "support": { "source": "https://github.com/nurmuhammet-ali/nova-tabs/tree/master" }, - "time": "2024-09-07T00:11:10+00:00" + "time": "2024-09-07T18:18:29+00:00" }, { "name": "eolica/nova-locale-switcher", @@ -9987,16 +9987,16 @@ }, { "name": "dragon-code/support", - "version": "6.13.0", + "version": "6.15.0", "source": { "type": "git", "url": "https://github.com/TheDragonCode/support.git", - "reference": "a6f0468e32581efbccb23190b6d5c880cc519747" + "reference": "087d7baaa963cdbb24e901dc27e10cdc31c2529c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TheDragonCode/support/zipball/a6f0468e32581efbccb23190b6d5c880cc519747", - "reference": "a6f0468e32581efbccb23190b6d5c880cc519747", + "url": "https://api.github.com/repos/TheDragonCode/support/zipball/087d7baaa963cdbb24e901dc27e10cdc31c2529c", + "reference": "087d7baaa963cdbb24e901dc27e10cdc31c2529c", "shasum": "" }, "require": { @@ -10082,7 +10082,7 @@ "type": "yoomoney" } ], - "time": "2024-03-12T20:45:00+00:00" + "time": "2024-09-07T13:27:37+00:00" }, { "name": "fakerphp/faker", @@ -10373,16 +10373,16 @@ }, { "name": "laravel-lang/actions", - "version": "1.8.4", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/Laravel-Lang/actions.git", - "reference": "1c88725b15a2fef11a2ed425eef40a31741e79c0" + "reference": "bc59d4a92e13d35d07a45265552a830c47fbe878" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Laravel-Lang/actions/zipball/1c88725b15a2fef11a2ed425eef40a31741e79c0", - "reference": "1c88725b15a2fef11a2ed425eef40a31741e79c0", + "url": "https://api.github.com/repos/Laravel-Lang/actions/zipball/bc59d4a92e13d35d07a45265552a830c47fbe878", + "reference": "bc59d4a92e13d35d07a45265552a830c47fbe878", "shasum": "" }, "require": { @@ -10434,9 +10434,9 @@ ], "support": { "issues": "https://github.com/Laravel-Lang/actions/issues", - "source": "https://github.com/Laravel-Lang/actions/tree/1.8.4" + "source": "https://github.com/Laravel-Lang/actions/tree/1.8.5" }, - "time": "2024-06-11T09:23:47+00:00" + "time": "2024-09-07T11:55:41+00:00" }, { "name": "laravel-lang/attributes", diff --git a/lang/tk.json b/lang/tk.json index 153e0eb..5b1cbb4 100644 --- a/lang/tk.json +++ b/lang/tk.json @@ -298,5 +298,6 @@ "Payment sender data": "Tölegi ugradyjynyň maglumatlar", "Payee information": "Tölegi kabul edijiniň maglumatlary", "Reciver files": "Kabul ediji talyp boýunça resminamalary", - "Sender files": "Ugradyjy boýunça resminamalary" + "Sender files": "Ugradyjy boýunça resminamalary", + "Next": "Indiki" } diff --git a/resources/views/vendor/nova/layout.blade.php b/resources/views/vendor/nova/layout.blade.php index c7eb5ef..509fd8c 100644 --- a/resources/views/vendor/nova/layout.blade.php +++ b/resources/views/vendor/nova/layout.blade.php @@ -10,6 +10,8 @@ @include('nova::partials.meta') + + @@ -29,6 +31,13 @@ +
+
+
+

Loading...

+
+
+ @inertia @@ -52,6 +61,8 @@