Add View Page for VisaMasterPaymentOrder and Update Schema

- Introduced ViewVisaMasterPaymentOrder page for displaying payment order details.
- Updated VisaMasterPaymentOrderResource to include a route for the new view page.
- Enhanced VisaMasterPaymentOrderInfolist schema to include location details and conditional visibility for notes.
- Enabled ViewAction in VisaMasterPaymentOrdersTable for accessing the new view page.
- Modified VisaMasterPaymentOrder model to allow nullable notes property.
This commit is contained in:
2025-11-18 01:09:35 +05:00
parent cbd469c97f
commit 438e5a3f43
5 changed files with 27 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOr
use App\Modules\OrderStatus\Repositories\OrderStatusRepository;
use App\Modules\Region\Repositories\RegionRepository;
use App\Modules\TurkmenPassport\Repositories\TurkmenPassportRepository;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use Filament\Infolists\Components\IconEntry;
use Filament\Infolists\Components\SpatieMediaLibraryImageEntry;
use Filament\Infolists\Components\TextEntry;
@@ -14,6 +15,7 @@ use Filament\Schemas\Components\Tabs;
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Illuminate\Support\Str;
class VisaMasterPaymentOrderInfolist
{
@@ -43,30 +45,28 @@ class VisaMasterPaymentOrderInfolist
->trueColor('success')
->falseColor('danger'),
Fieldset::make(__('Location'))
->schema([
TextEntry::make('region')
->label(__('Region'))
->formatStateUsing(fn (string $state): string => RegionRepository::label($state)),
TextEntry::make('branch.name')
->label(__('Branch'))
->placeholder('-'),
])
->columnSpan(1),
TextEntry::make('notes')
->label(__('Bellik'))
->html()
->columnSpanFull()
->visible(fn (VisaMasterPaymentOrder $record): bool => ! is_null($record->notes) && $record->notes != '' && $record->notes != '<p></p>' && Str::length($record->notes) > 7)
->columnSpan(2)
->placeholder('-'),
]),
Tabs::make('Order Information')
->tabs([
Tab::make(__('Order type and bank'))
->schema([
Fieldset::make(__('Location'))
->schema([
TextEntry::make('region')
->label(__('Region'))
->formatStateUsing(fn ($state) => RegionRepository::values()[$state] ?? $state),
TextEntry::make('branch.name')
->label(__('Branch'))
->placeholder('-'),
]),
]),
Tab::make(__('Payment sender data'))
->columns(8)
->schema([