Refactor VisaMasterPaymentOrder components and enhance seeding process

- Updated record title attribute in VisaMasterPaymentOrderResource to 'unique_id'.
- Improved schema layout in VisaMasterPaymentOrderForm and VisaMasterPaymentOrderInfolist for better user experience.
- Added 'unique_id' field to VisaMasterPaymentOrderInfolist with styling adjustments.
- Implemented BelongsToBranch interface in VisaMasterPaymentOrder model and added a boot method for loan order creation.
- Expanded FillJsonData seeder to include migration for VisaMasterPaymentOrders.
This commit is contained in:
Mekan1206
2025-12-21 02:58:15 +05:00
parent 4fc242bc7d
commit 2ec9b28a60
7 changed files with 85 additions and 13 deletions

View File

@@ -148,15 +148,9 @@ class VisaMasterPaymentOrderForm
->columns(2)
->schema([
AdvancedFileUpload::make('sender_passport_local')
->collection('sender_passport_local')
->spatieMediaLibrary()
->spatieMediaLibrary(collection: 'sender_passport_local')
->multiple(),
// SpatieMediaLibraryFileUpload::make('sender_passport_local')
// ->collection('sender_passport_local')
// ->label(__('Ugradyja degişli Türkmenistanyň raýatynyň (içki milli) pasportynyň asyl görnüşi we göçürmesi'))
// ->required(),
SpatieMediaLibraryFileUpload::make('sender_passport_international')
->collection('sender_passport_international')
->label(__('Ugradyja degişli Türkmenistandan çykmak we Türkmenistana girmek üçin pasportynyň asyl görnüşi we göçürmesi')),

View File

@@ -25,8 +25,13 @@ class VisaMasterPaymentOrderInfolist
->components([
Section::make()
->columnSpanFull()
->columns(3)
->columns(4)
->components([
TextEntry::make('unique_id')
->label(__('Order ID'))
->columnSpan(1)
->extraAttributes(['style' => 'text-transform:uppercase;font-size:1.5em;font-weight:bold;']),
TextEntry::make('type')
->label(__('Payment type'))
->extraAttributes(['style' => 'text-transform:uppercase;font-size:1.5em;font-weight:bold;']),
@@ -55,7 +60,7 @@ class VisaMasterPaymentOrderInfolist
->label(__('Branch'))
->placeholder('-'),
])
->columnSpan(1),
->columnSpan(2),
TextEntry::make('notes')
->label(__('Bellik'))

View File

@@ -25,7 +25,7 @@ class VisaMasterPaymentOrderResource extends Resource
protected static ?string $cluster = VisaMasterPaymentsCluster::class;
protected static ?string $recordTitleAttribute = 'id';
protected static ?string $recordTitleAttribute = 'unique_id';
protected static string|BackedEnum|null $navigationIcon = 'icon-visa-plain';

View File

@@ -3,7 +3,9 @@
namespace App\Modules\VisaMasterPaymentOrder\Models;
use App\Models\User;
use App\Modules\Branch\Interfaces\BelongsToBranch;
use App\Modules\Branch\Models\Branch;
use App\Modules\LoanOrder\Repositories\LoanOrderRepository;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -35,7 +37,7 @@ use Spatie\MediaLibrary\InteractsWithMedia;
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
*/
class VisaMasterPaymentOrder extends Model implements HasMedia
class VisaMasterPaymentOrder extends Model implements HasMedia, BelongsToBranch
{
use InteractsWithMedia;
use SoftDeletes;
@@ -116,4 +118,14 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
$this->addMediaCollection('sender_passport_local_old')->singleFile();
$this->addMediaCollection('sender_passport_local_old_replacement')->singleFile();
}
/**
* "boot" method for model
*/
protected static function boot()
{
parent::boot();
static::created(LoanOrderRepository::created());
}
}