translate
This commit is contained in:
@@ -13,6 +13,8 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('swift_payments', function (Blueprint $table) {
|
Schema::create('swift_payments', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->string('unique_id')->nullable()->unique();
|
||||||
|
|
||||||
$table->string('type')->nullable();
|
$table->string('type')->nullable();
|
||||||
$table->string('passport_name')->nullable();
|
$table->string('passport_name')->nullable();
|
||||||
$table->string('passport_surname')->nullable();
|
$table->string('passport_surname')->nullable();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Modules\Swiftpayment\Models;
|
namespace App\Modules\Swiftpayment\Models;
|
||||||
|
|
||||||
use App\Models\Branch\Branch;
|
use App\Models\Branch\Branch;
|
||||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\Swiftpayment\Nova\Resources\Concerns;
|
||||||
|
|
||||||
|
use App\Modules\Swiftpayment\Models\ApplicationTypes;
|
||||||
|
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 SwiftpaymentFieldsForIndex
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 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(ApplicationTypes::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(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,20 +4,22 @@ namespace App\Modules\Swiftpayment\Nova\Resources;
|
|||||||
|
|
||||||
use App\Models\Branch\Branch;
|
use App\Models\Branch\Branch;
|
||||||
use App\Modules\Swiftpayment\Models\ApplicationTypes;
|
use App\Modules\Swiftpayment\Models\ApplicationTypes;
|
||||||
use App\Modules\Swiftpayment\Models\SwiftPaymentStatus;
|
use App\Modules\Swiftpayment\Nova\Resources\Concerns\SwiftpaymentFieldsForIndex;
|
||||||
use App\Nova\Resource;
|
use App\Nova\Resource;
|
||||||
|
use App\Repos\Order\Card\CardOrderRepo;
|
||||||
use App\Repos\Order\OrderRepo;
|
use App\Repos\Order\OrderRepo;
|
||||||
use App\Repos\System\Nova\NovaRepo;
|
use App\Repos\System\Nova\NovaRepo;
|
||||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||||
use App\Repos\System\Settings\Location\RegionRepo;
|
use App\Repos\System\Settings\Location\RegionRepo;
|
||||||
use Ebess\AdvancedNovaMediaLibrary\Fields\Files;
|
use Ebess\AdvancedNovaMediaLibrary\Fields\Files;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Laravel\Nova\Fields\Badge;
|
use Laravel\Nova\Fields\Badge;
|
||||||
use Laravel\Nova\Fields\Hidden;
|
use Laravel\Nova\Fields\Hidden;
|
||||||
use Laravel\Nova\Fields\ID;
|
use Laravel\Nova\Fields\ID;
|
||||||
use Laravel\Nova\Fields\Select;
|
use Laravel\Nova\Fields\Select;
|
||||||
use Laravel\Nova\Fields\Text;
|
use Laravel\Nova\Fields\Text;
|
||||||
use Laravel\Nova\Fields\Trix;
|
|
||||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||||
|
use Laravel\Nova\Panel;
|
||||||
use Nurmuhammet\NovaInputmask\NovaInputmask;
|
use Nurmuhammet\NovaInputmask\NovaInputmask;
|
||||||
use Outl1ne\NovaSimpleRepeatable\SimpleRepeatable;
|
use Outl1ne\NovaSimpleRepeatable\SimpleRepeatable;
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ class NovaSwiftpayment extends Resource
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $title = 'id';
|
public static $title = 'unique_id';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The columns that should be searched.
|
* The columns that should be searched.
|
||||||
@@ -46,7 +48,7 @@ class NovaSwiftpayment extends Resource
|
|||||||
* @var array<int, string>
|
* @var array<int, string>
|
||||||
*/
|
*/
|
||||||
public static $search = [
|
public static $search = [
|
||||||
'id',
|
'unique_id', 'passport_name', 'passport_surname', 'phone',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +56,7 @@ class NovaSwiftpayment extends Resource
|
|||||||
*/
|
*/
|
||||||
public static function label(): string
|
public static function label(): string
|
||||||
{
|
{
|
||||||
return __('Swiftpayments');
|
return __('Swift payments');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +64,26 @@ class NovaSwiftpayment extends Resource
|
|||||||
*/
|
*/
|
||||||
public static function singularLabel(): string
|
public static function singularLabel(): string
|
||||||
{
|
{
|
||||||
return __('Swiftpayment');
|
return __('Swift payment');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After resource created
|
||||||
|
*
|
||||||
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
||||||
|
* @param \Illuminate\Database\Eloquent\Model $model
|
||||||
|
*/
|
||||||
|
public static function afterCreate(NovaRequest $request, Model $model): void
|
||||||
|
{
|
||||||
|
$model->update(['unique_id' => CardOrderRepo::fillUniqueId($model)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the fields for index.
|
||||||
|
*/
|
||||||
|
public function fieldsForIndex(): array
|
||||||
|
{
|
||||||
|
return SwiftpaymentFieldsForIndex::make($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,117 +95,129 @@ class NovaSwiftpayment extends Resource
|
|||||||
public function fields(NovaRequest $request): array
|
public function fields(NovaRequest $request): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
ID::make('id')->sortable(),
|
ID::hidden('id'),
|
||||||
|
|
||||||
Hidden::make('user_id')->default(auth()->id()),
|
Hidden::make('user_id')
|
||||||
|
->default(auth()->id())
|
||||||
|
->hideWhenUpdating(),
|
||||||
|
|
||||||
Select::make(__('Status'), 'status')
|
new Panel(__('New :resource', ['resource' => $this->singularLabel()]), [
|
||||||
->displayUsingLabels()
|
Text::make(__('ID'), 'unique_id')
|
||||||
->searchable()
|
->exceptOnForms(),
|
||||||
->options(OrderRepo::statusValues())
|
|
||||||
->default(OrderRepo::defaultStatus())
|
|
||||||
->fullWidth()
|
|
||||||
->rules('required')
|
|
||||||
->canSeeWhen('systemUser', $this),
|
|
||||||
|
|
||||||
Select::make(__('Ýüztutmanyň görnüşi'), 'type')
|
Select::make(__('Status'), 'status')
|
||||||
->fullWidth()
|
|
||||||
->searchable()
|
|
||||||
->rules('required')
|
|
||||||
->displayUsingLabels()
|
|
||||||
->options(ApplicationTypes::applicationTypes()),
|
|
||||||
|
|
||||||
Select::make(__('Region'), 'region')
|
|
||||||
->fullWidth()
|
|
||||||
->displayUsingLabels()
|
|
||||||
->searchable()
|
|
||||||
->options(RegionRepo::values())
|
|
||||||
->default(RegionRepo::default())
|
|
||||||
->rules('required')
|
|
||||||
->sortable(),
|
|
||||||
|
|
||||||
Select::make(__('Branch'), 'branch_id')
|
|
||||||
->fullWidth()
|
|
||||||
->displayUsingLabels()
|
|
||||||
->searchable()
|
|
||||||
->dependsOn('region', NovaRepo::dependsOnRegion('region', Branch::class))
|
|
||||||
->rules('required')
|
|
||||||
->sortable(),
|
|
||||||
|
|
||||||
Text::make('Pasportdaky ady', 'passport_name')
|
|
||||||
->fullWidth()
|
|
||||||
->rules('required', 'string', 'max:255'),
|
|
||||||
|
|
||||||
Text::make('Pasportdaky familiýa', 'passport_surname')
|
|
||||||
->fullWidth()
|
|
||||||
->rules('required', 'string', 'max:255'),
|
|
||||||
|
|
||||||
NovaInputmask::make('Telefon belgi', 'phone')
|
|
||||||
->fullWidth()
|
|
||||||
->phonenumber('TM')
|
|
||||||
->rules('required', 'max:255')
|
|
||||||
->hideFromIndex(),
|
|
||||||
|
|
||||||
Text::make('Email', 'email')
|
|
||||||
->fullWidth()
|
|
||||||
->rules('required', 'max:255', 'email')
|
|
||||||
->hideFromIndex(),
|
|
||||||
|
|
||||||
Text::make('Ýaşaýan ýeriň salgysy', 'address')
|
|
||||||
->fullWidth()
|
|
||||||
->rules('required', 'string', 'max:255')
|
|
||||||
->hideFromIndex(),
|
|
||||||
|
|
||||||
SimpleRepeatable::make('Tölegi ugradyjynyň maglumatlar', 'sender_datas', [
|
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
->searchable()
|
->searchable()
|
||||||
->options(PassportRepo::values())
|
->options(OrderRepo::statusValues())
|
||||||
|
->default(OrderRepo::defaultStatus())
|
||||||
|
->fullWidth()
|
||||||
|
->hideFromDetail()
|
||||||
|
->rules('required')
|
||||||
|
->canSeeWhen('systemUser', $this),
|
||||||
|
|
||||||
|
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', $this),
|
||||||
|
]),
|
||||||
|
|
||||||
|
new Panel(__('Location'), [
|
||||||
|
Select::make(__('Ýüztutmanyň görnüşi'), 'type')
|
||||||
|
->fullWidth()
|
||||||
|
->searchable()
|
||||||
|
->rules('required')
|
||||||
|
->displayUsingLabels()
|
||||||
|
->options(ApplicationTypes::applicationTypes()),
|
||||||
|
|
||||||
|
Select::make(__('Region'), 'region')
|
||||||
|
->fullWidth()
|
||||||
|
->displayUsingLabels()
|
||||||
|
->searchable()
|
||||||
|
->options(RegionRepo::values())
|
||||||
|
->default(RegionRepo::default())
|
||||||
->rules('required')
|
->rules('required')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
NovaInputmask::make('Passport nomeri')
|
Select::make(__('Branch'), 'branch_id')
|
||||||
->mask('999999')
|
->fullWidth()
|
||||||
->rules('required', 'max:255'),
|
|
||||||
|
|
||||||
Text::make('A.F.AA'),
|
|
||||||
])->minRows(1)->rules('required'),
|
|
||||||
|
|
||||||
SimpleRepeatable::make('Tölegi kabul edijiniň maglumatlary', 'payment_reciever', [
|
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
->searchable()
|
->searchable()
|
||||||
->options(PassportRepo::values())
|
->dependsOn('region', NovaRepo::dependsOnRegion('region', Branch::class))
|
||||||
->rules('required')
|
->rules('required')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
]),
|
||||||
|
|
||||||
NovaInputmask::make('Passport nomeri')
|
new Panel(__('Personal data'), [
|
||||||
->mask('999999')
|
Text::make('Pasportdaky ady', 'passport_name')
|
||||||
->rules('required', 'max:255'),
|
->fullWidth()
|
||||||
|
->rules('required', 'string', 'max:255'),
|
||||||
|
|
||||||
Text::make('A.F.AA'),
|
Text::make('Pasportdaky familiýa', 'passport_surname')
|
||||||
])->maxRows(1)->rules('required'),
|
->fullWidth()
|
||||||
|
->rules('required', 'string', 'max:255'),
|
||||||
|
|
||||||
Files::make('Talap edilýän resminamalar', 'main')
|
NovaInputmask::make('Telefon belgi', 'phone')
|
||||||
->conversionOnIndexView('thumb')
|
->fullWidth()
|
||||||
->rules('required')
|
->phonenumber('TM')
|
||||||
->hideFromIndex(),
|
->rules('required', 'max:255')
|
||||||
|
->hideFromIndex(),
|
||||||
|
|
||||||
Badge::make(__('Status'), 'status')
|
Text::make('Email', 'email')
|
||||||
->map(OrderRepo::statusClasses())
|
->fullWidth()
|
||||||
->addTypes([
|
->rules('required', 'max:255', 'email')
|
||||||
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
|
->hideFromIndex(),
|
||||||
])
|
|
||||||
->labels(OrderRepo::statusValues())
|
|
||||||
->withIcons()
|
|
||||||
->icons(OrderRepo::statusIcons()),
|
|
||||||
|
|
||||||
Trix::make(__('Notes'), 'notes')
|
Text::make('Ýaşaýan ýeriň salgysy', 'address')
|
||||||
->hideWhenCreating()
|
->fullWidth()
|
||||||
->alwaysShow()
|
->rules('required', 'string', 'max:255')
|
||||||
->readonly(function ($request) {
|
->hideFromIndex(),
|
||||||
return ! $request->user()->hasRole(['admin', 'manager', 'operator']);
|
]),
|
||||||
}),
|
|
||||||
|
new Panel(__('Töleg'), [
|
||||||
|
SimpleRepeatable::make('Tölegi ugradyjynyň maglumatlar', 'sender_datas', [
|
||||||
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
|
->displayUsingLabels()
|
||||||
|
->searchable()
|
||||||
|
->options(PassportRepo::values())
|
||||||
|
->rules('required')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
NovaInputmask::make('Passport nomeri')
|
||||||
|
->mask('999999')
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
|
Text::make('A.F.AA'),
|
||||||
|
])->minRows(1)->rules('required'),
|
||||||
|
|
||||||
|
SimpleRepeatable::make('Tölegi kabul edijiniň maglumatlary', 'payment_reciever', [
|
||||||
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
|
->displayUsingLabels()
|
||||||
|
->searchable()
|
||||||
|
->options(PassportRepo::values())
|
||||||
|
->rules('required')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
NovaInputmask::make('Passport nomeri')
|
||||||
|
->mask('999999')
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
|
Text::make('A.F.AA'),
|
||||||
|
])->maxRows(1)->minRows(1)->rules('required'),
|
||||||
|
|
||||||
|
Files::make('Talap edilýän resminamalar', 'main')
|
||||||
|
->conversionOnIndexView('thumb')
|
||||||
|
->rules('required')
|
||||||
|
->required()
|
||||||
|
->hideFromIndex(),
|
||||||
|
]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ class NovaMenuRepo
|
|||||||
])->collapsedByDefault(),
|
])->collapsedByDefault(),
|
||||||
|
|
||||||
MenuGroup::make(__('Swift payments'), [
|
MenuGroup::make(__('Swift payments'), [
|
||||||
MenuItem::resource(NovaSwiftpayment::class),
|
MenuItem::resource(NovaSwiftpayment::class)
|
||||||
|
->name(sprintf('%s (%s)', __('International payments'), __('Visa, Master, Sber, WU'))),
|
||||||
])->collapsedByDefault(),
|
])->collapsedByDefault(),
|
||||||
])->icon('ticket')->collapsedByDefault(),
|
])->icon('ticket')->collapsedByDefault(),
|
||||||
|
|
||||||
|
|||||||
@@ -284,5 +284,8 @@
|
|||||||
"Client": "Müşderi",
|
"Client": "Müşderi",
|
||||||
"Successfully registered": "Üstünlikli hasaba alyndyňyz",
|
"Successfully registered": "Üstünlikli hasaba alyndyňyz",
|
||||||
"Please, now verify your phone number to continue": "Dowam etmek üçin telefon belgiňizi tassyklaň",
|
"Please, now verify your phone number to continue": "Dowam etmek üçin telefon belgiňizi tassyklaň",
|
||||||
"Swift payments": "Swift tölegler"
|
"Swift payments": "Swift tölegler",
|
||||||
|
"Swift payment": "Swift töleg",
|
||||||
|
"International payments": "Halkara tölegler",
|
||||||
|
"Visa, Master, Sber, WU": "Visa, Master, Sber, WU"
|
||||||
}
|
}
|
||||||
|
|||||||
3
lang/vendor/nova-simple-repeatable-field/en.json
vendored
Normal file
3
lang/vendor/nova-simple-repeatable-field/en.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"simpleRepeatable.addRow": "Add row"
|
||||||
|
}
|
||||||
3
lang/vendor/nova-simple-repeatable-field/ru.json
vendored
Normal file
3
lang/vendor/nova-simple-repeatable-field/ru.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"simpleRepeatable.addRow": "Добавить строку"
|
||||||
|
}
|
||||||
3
lang/vendor/nova-simple-repeatable-field/tk.json
vendored
Normal file
3
lang/vendor/nova-simple-repeatable-field/tk.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"simpleRepeatable.addRow": "Setir goş"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user