fix payments
This commit is contained in:
@@ -12,7 +12,7 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('swift_payments', function (Blueprint $table) {
|
Schema::create('swift_payments', function (Blueprint $table) {
|
||||||
$table->uuid('id');
|
$table->id();
|
||||||
$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();
|
||||||
@@ -41,6 +41,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
//
|
Schema::dropIfExists('swift_payments');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
|||||||
|
|
||||||
class Swiftpayment extends Model implements HasMedia
|
class Swiftpayment extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
use HasUuids;
|
|
||||||
use InteractsWithMedia;
|
use InteractsWithMedia;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ 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\Models\SwiftPaymentStatus;
|
||||||
use App\Nova\Resource;
|
use App\Nova\Resource;
|
||||||
|
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;
|
||||||
@@ -77,13 +78,24 @@ class NovaSwiftpayment extends Resource
|
|||||||
|
|
||||||
Hidden::make('user_id')->default(auth()->id()),
|
Hidden::make('user_id')->default(auth()->id()),
|
||||||
|
|
||||||
|
Select::make(__('Status'), 'status')
|
||||||
|
->displayUsingLabels()
|
||||||
|
->searchable()
|
||||||
|
->options(OrderRepo::statusValues())
|
||||||
|
->default(OrderRepo::defaultStatus())
|
||||||
|
->fullWidth()
|
||||||
|
->rules('required')
|
||||||
|
->canSeeWhen('systemUser', $this),
|
||||||
|
|
||||||
Select::make(__('Ýüztutmanyň görnüşi'), 'type')
|
Select::make(__('Ýüztutmanyň görnüşi'), 'type')
|
||||||
|
->fullWidth()
|
||||||
->searchable()
|
->searchable()
|
||||||
->rules('required')
|
->rules('required')
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
->options(ApplicationTypes::applicationTypes()),
|
->options(ApplicationTypes::applicationTypes()),
|
||||||
|
|
||||||
Select::make(__('Region'), 'region')
|
Select::make(__('Region'), 'region')
|
||||||
|
->fullWidth()
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
->searchable()
|
->searchable()
|
||||||
->options(RegionRepo::values())
|
->options(RegionRepo::values())
|
||||||
@@ -92,6 +104,7 @@ class NovaSwiftpayment extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
Select::make(__('Branch'), 'branch_id')
|
Select::make(__('Branch'), 'branch_id')
|
||||||
|
->fullWidth()
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
->searchable()
|
->searchable()
|
||||||
->dependsOn('region', NovaRepo::dependsOnRegion('region', Branch::class))
|
->dependsOn('region', NovaRepo::dependsOnRegion('region', Branch::class))
|
||||||
@@ -99,21 +112,26 @@ class NovaSwiftpayment extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
Text::make('Pasportdaky ady', 'passport_name')
|
Text::make('Pasportdaky ady', 'passport_name')
|
||||||
|
->fullWidth()
|
||||||
->rules('required', 'string', 'max:255'),
|
->rules('required', 'string', 'max:255'),
|
||||||
|
|
||||||
Text::make('Pasportdaky familiýa', 'passport_surname')
|
Text::make('Pasportdaky familiýa', 'passport_surname')
|
||||||
|
->fullWidth()
|
||||||
->rules('required', 'string', 'max:255'),
|
->rules('required', 'string', 'max:255'),
|
||||||
|
|
||||||
NovaInputmask::make('Telefon belgi', 'phone')
|
NovaInputmask::make('Telefon belgi', 'phone')
|
||||||
|
->fullWidth()
|
||||||
->phonenumber('TM')
|
->phonenumber('TM')
|
||||||
->rules('required', 'max:255')
|
->rules('required', 'max:255')
|
||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
|
|
||||||
Text::make('Email', 'email')
|
Text::make('Email', 'email')
|
||||||
|
->fullWidth()
|
||||||
->rules('required', 'max:255', 'email')
|
->rules('required', 'max:255', 'email')
|
||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
|
|
||||||
Text::make('Ýaşaýan ýeriň salgysy', 'address')
|
Text::make('Ýaşaýan ýeriň salgysy', 'address')
|
||||||
|
->fullWidth()
|
||||||
->rules('required', 'string', 'max:255')
|
->rules('required', 'string', 'max:255')
|
||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
|
|
||||||
@@ -152,18 +170,14 @@ class NovaSwiftpayment extends Resource
|
|||||||
->rules('required')
|
->rules('required')
|
||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
|
|
||||||
Badge::make('Status')->map(SwiftPaymentStatus::classes())->addTypes([
|
Badge::make(__('Status'), 'status')
|
||||||
|
->map(OrderRepo::statusClasses())
|
||||||
|
->addTypes([
|
||||||
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
|
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
|
||||||
])->labels(SwiftPaymentStatus::values()),
|
])
|
||||||
|
->labels(OrderRepo::statusValues())
|
||||||
Select::make(__('Status'), 'status')
|
->withIcons()
|
||||||
->onlyOnForms()
|
->icons(OrderRepo::statusIcons()),
|
||||||
->hideWhenCreating()
|
|
||||||
->displayUsingLabels()
|
|
||||||
->options(SwiftPaymentStatus::values())
|
|
||||||
->canSee(function ($request) {
|
|
||||||
return $request->user()->hasRole(['admin', 'manager', 'operator']);
|
|
||||||
}),
|
|
||||||
|
|
||||||
Trix::make(__('Notes'), 'notes')
|
Trix::make(__('Notes'), 'notes')
|
||||||
->hideWhenCreating()
|
->hideWhenCreating()
|
||||||
|
|||||||
Reference in New Issue
Block a user