test
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('visa_master_payment_order_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('visa_master_payment_order_id')->constrained('visa_master_payment_orders')->nullOnDelete();
|
||||
$table->foreignId('online_payment_history_id')->nullable()->constrained('online_payment_histories')->nullOnDelete();
|
||||
|
||||
$table->string('payer_name')->nullable();
|
||||
$table->string('payer_card')->nullable();
|
||||
|
||||
$table->string('payment_order_number')->nullable();
|
||||
|
||||
$table->string('tmt_payment_amount');
|
||||
$table->string('usd_payment_amount');
|
||||
$table->boolean('paid')->default(false);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('visa_master_payment_order_items');
|
||||
}
|
||||
};
|
||||
@@ -8,6 +8,7 @@ use App\Repos\Order\Loan\LoanOrderRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
@@ -89,6 +90,14 @@ class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
return $this->belongsTo(Branch::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment itmes
|
||||
*/
|
||||
public function paymentItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(VisaMasterPaymentOrderItem::class, 'visa_master_payment_order_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get applications types
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\VisaMasterPaymentOrder\Models;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
use App\Models\User;
|
||||
use App\Repos\Order\Loan\LoanOrderRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
|
||||
class VisaMasterPaymentOrderItem extends Model implements HasMedia
|
||||
{
|
||||
use InteractsWithMedia;
|
||||
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'visa_master_payment_order_items';
|
||||
|
||||
/**
|
||||
* Guarded attributes
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Parent order
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(VisaMasterPaymentOrder::class, 'visa_master_payment_order_id');
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Nova\Fields\Badge;
|
||||
use Laravel\Nova\Fields\HasMany;
|
||||
use Laravel\Nova\Fields\Hidden;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\Select;
|
||||
@@ -342,6 +343,8 @@ class NovaVisaMasterPaymentOrder extends Resource
|
||||
'sender_passport_local_old_replacement'
|
||||
),
|
||||
]),
|
||||
|
||||
// HasMany::make(__('Payment items'), 'paymentItems', ),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user