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:
@@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages;
|
namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Schemas\VisaMasterPaymentOrderInfolist;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\VisaMasterPaymentOrderResource;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\VisaMasterPaymentOrderResource;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
use Filament\Resources\Pages\ViewRecord;
|
use Filament\Resources\Pages\ViewRecord;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\Icons\Heroicon;
|
use Filament\Support\Icons\Heroicon;
|
||||||
|
|
||||||
class ViewVisaMasterPaymentOrder extends ViewRecord
|
class ViewVisaMasterPaymentOrder extends ViewRecord
|
||||||
@@ -18,4 +20,9 @@ class ViewVisaMasterPaymentOrder extends ViewRecord
|
|||||||
->icon(Heroicon::OutlinedPencil),
|
->icon(Heroicon::OutlinedPencil),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function infolist(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return VisaMasterPaymentOrderInfolist::configure($schema);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOr
|
|||||||
use App\Modules\OrderStatus\Repositories\OrderStatusRepository;
|
use App\Modules\OrderStatus\Repositories\OrderStatusRepository;
|
||||||
use App\Modules\Region\Repositories\RegionRepository;
|
use App\Modules\Region\Repositories\RegionRepository;
|
||||||
use App\Modules\TurkmenPassport\Repositories\TurkmenPassportRepository;
|
use App\Modules\TurkmenPassport\Repositories\TurkmenPassportRepository;
|
||||||
|
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
|
||||||
use Filament\Infolists\Components\IconEntry;
|
use Filament\Infolists\Components\IconEntry;
|
||||||
use Filament\Infolists\Components\SpatieMediaLibraryImageEntry;
|
use Filament\Infolists\Components\SpatieMediaLibraryImageEntry;
|
||||||
use Filament\Infolists\Components\TextEntry;
|
use Filament\Infolists\Components\TextEntry;
|
||||||
@@ -14,6 +15,7 @@ use Filament\Schemas\Components\Tabs;
|
|||||||
use Filament\Schemas\Components\Tabs\Tab;
|
use Filament\Schemas\Components\Tabs\Tab;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\Icons\Heroicon;
|
use Filament\Support\Icons\Heroicon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class VisaMasterPaymentOrderInfolist
|
class VisaMasterPaymentOrderInfolist
|
||||||
{
|
{
|
||||||
@@ -43,30 +45,28 @@ class VisaMasterPaymentOrderInfolist
|
|||||||
->trueColor('success')
|
->trueColor('success')
|
||||||
->falseColor('danger'),
|
->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')
|
TextEntry::make('notes')
|
||||||
->label(__('Bellik'))
|
->label(__('Bellik'))
|
||||||
->html()
|
->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('-'),
|
->placeholder('-'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
Tabs::make('Order Information')
|
Tabs::make('Order Information')
|
||||||
->tabs([
|
->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'))
|
Tab::make(__('Payment sender data'))
|
||||||
->columns(8)
|
->columns(8)
|
||||||
->schema([
|
->schema([
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class VisaMasterPaymentOrdersTable
|
|||||||
TrashedFilter::make(),
|
TrashedFilter::make(),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
// ViewAction::make(),
|
ViewAction::make(),
|
||||||
EditAction::make(),
|
EditAction::make(),
|
||||||
])
|
])
|
||||||
->toolbarActions([
|
->toolbarActions([
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOr
|
|||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\CreateVisaMasterPaymentOrder;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\CreateVisaMasterPaymentOrder;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\EditVisaMasterPaymentOrder;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\EditVisaMasterPaymentOrder;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\ListVisaMasterPaymentOrders;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\ListVisaMasterPaymentOrders;
|
||||||
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\ViewVisaMasterPaymentOrder;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Schemas\VisaMasterPaymentOrderForm;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Schemas\VisaMasterPaymentOrderForm;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Tables\VisaMasterPaymentOrdersTable;
|
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Tables\VisaMasterPaymentOrdersTable;
|
||||||
use App\Filament\Clusters\VisaMasterPayments\VisaMasterPaymentsCluster;
|
use App\Filament\Clusters\VisaMasterPayments\VisaMasterPaymentsCluster;
|
||||||
@@ -65,6 +66,7 @@ class VisaMasterPaymentOrderResource extends Resource
|
|||||||
return [
|
return [
|
||||||
'index' => ListVisaMasterPaymentOrders::route('/'),
|
'index' => ListVisaMasterPaymentOrders::route('/'),
|
||||||
'create' => CreateVisaMasterPaymentOrder::route('/create'),
|
'create' => CreateVisaMasterPaymentOrder::route('/create'),
|
||||||
|
'view' => ViewVisaMasterPaymentOrder::route('/{record}/view'),
|
||||||
'edit' => EditVisaMasterPaymentOrder::route('/{record}/edit'),
|
'edit' => EditVisaMasterPaymentOrder::route('/{record}/edit'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ use Spatie\MediaLibrary\InteractsWithMedia;
|
|||||||
* @property array<string, string> $payment_reciever
|
* @property array<string, string> $payment_reciever
|
||||||
* @property array<string, string> $documents
|
* @property array<string, string> $documents
|
||||||
* @property string $status
|
* @property string $status
|
||||||
* @property string $notes
|
* @property ?string $notes
|
||||||
* @property string $sender_full_name
|
* @property string $sender_full_name
|
||||||
* @property string $sender_passport_serie
|
* @property string $sender_passport_serie
|
||||||
* @property string $sender_passport_number
|
* @property string $sender_passport_number
|
||||||
|
|||||||
Reference in New Issue
Block a user