- 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.
87 lines
2.9 KiB
PHP
87 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders;
|
|
|
|
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\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\Tables\VisaMasterPaymentOrdersTable;
|
|
use App\Filament\Clusters\VisaMasterPayments\VisaMasterPaymentsCluster;
|
|
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
class VisaMasterPaymentOrderResource extends Resource
|
|
{
|
|
protected static ?int $navigationSort = 1;
|
|
|
|
protected static ?string $model = VisaMasterPaymentOrder::class;
|
|
|
|
protected static ?string $cluster = VisaMasterPaymentsCluster::class;
|
|
|
|
protected static ?string $recordTitleAttribute = 'id';
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'icon-visa-plain';
|
|
|
|
public static function getNavigationGroup(): ?string
|
|
{
|
|
return __('Visa/Master payments');
|
|
}
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return __('Visa/Master payment');
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return __('Visa/Master payments');
|
|
}
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return VisaMasterPaymentOrderForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return VisaMasterPaymentOrdersTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListVisaMasterPaymentOrders::route('/'),
|
|
'create' => CreateVisaMasterPaymentOrder::route('/create'),
|
|
'view' => ViewVisaMasterPaymentOrder::route('/{record}/view'),
|
|
'edit' => EditVisaMasterPaymentOrder::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the query for the record route binding
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Builder<\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder>
|
|
*/
|
|
public static function getRecordRouteBindingEloquentQuery(): Builder
|
|
{
|
|
return parent::getRecordRouteBindingEloquentQuery()
|
|
->withoutGlobalScopes([
|
|
SoftDeletingScope::class,
|
|
]);
|
|
}
|
|
}
|