$sender_datas * @property array $payment_reciever * @property array $documents * @property string $status * @property ?string $notes * @property string $sender_full_name * @property string $sender_passport_serie * @property string $sender_passport_number * @property string $sender_deposit_account * @property bool $paid * @property \Illuminate\Support\Carbon $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $deleted_at */ class VisaMasterPaymentOrder extends Model implements HasMedia, BelongsToBranch { use InteractsWithMedia; use SoftDeletes; protected $table = 'visa_master_payment_orders'; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'sender_datas' => 'array', 'payment_reciever' => 'array', ]; /** * User * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Branch * * @return BelongsTo */ public function branch(): BelongsTo { return $this->belongsTo(Branch::class); } /** * Payment itmes * * @return HasMany */ public function paymentItems(): HasMany { return $this->hasMany(VisaMasterPaymentOrderItem::class, 'visa_master_payment_order_id'); } /** * Get applications types * * @return array */ public static function applicationTypes(): array { return [ 'visa' => __('Visa'), 'master' => __('Master'), ]; } /** * Media collections */ public function registerMediaCollections(): void { $this->addMediaCollection('receiver_requisite')->singleFile(); $this->addMediaCollection('receiver_document_stating_he_is_studying')->singleFile(); $this->addMediaCollection('receiver_ticket')->singleFile(); $this->addMediaCollection('receiver_passport_local')->singleFile(); $this->addMediaCollection('receiver_passport_international')->singleFile(); $this->addMediaCollection('receiver_visa')->singleFile(); $this->addMediaCollection('receiver_travel_stamp_on_passport')->singleFile(); $this->addMediaCollection('receiver_document_stating_he_is_studying_2')->singleFile(); $this->addMediaCollection('sender_passport_local')->singleFile(); $this->addMediaCollection('sender_passport_international')->singleFile(); $this->addMediaCollection('sender_travel_stamp_on_passport')->singleFile(); $this->addMediaCollection('sender_proof_of_kinship')->singleFile(); $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()); } }