Merge pull request #5 from alealien666/paymentType

patch 2.2
This commit is contained in:
AleAlien 2025-02-12 16:29:04 +07:00 committed by GitHub
commit 9d61f551ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 8 deletions

View File

@ -4,15 +4,27 @@
use App\Models\Payment;
use Illuminate\Http\Request;
use App\Models\Santri;
use Inertia\Inertia;
class PaymentController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
public function index() {}
public function manualPayment()
{
//
$santri = Santri::with('payments', 'payments.detailPayments', 'payments.detailPayments.paymentType')->get();
return Inertia::render('list-admin/payment/ManualPayment', [
'santri' => $santri,
'fields' => [
'nis' => 'text',
]
]);
}
/**

View File

@ -13,7 +13,6 @@ public function up(): void
{
Schema::create('santris', function (Blueprint $table) {
$table->id();
// $table->string('nis');
$table->string('nama');
$table->string('alamat');
$table->enum('status_santri', ['boyong', 'aktif']);

View File

@ -15,10 +15,9 @@ public function up(): void
$table->id();
$table->enum('payment_status', ['pending', 'failed', 'success']);
$table->float('amount_payment');
$table->enum('payment_method', ['online', 'offline']);
$table->String('bank');
$table->string('no_va');
$table->dateTime('expired_at');
$table->String('bank')->nullable();
$table->string('no_va')->nullable();
$table->dateTime('expired_at')->nullable();
$table->foreignId('santri_id')->constrained('santris')->onDelete('cascade');
$table->foreignId('wallet_id')->constrained('wallets')->onDelete('cascade');
$table->timestamps();

View File

@ -14,10 +14,11 @@ public function up(): void
Schema::create('detail_payments', function (Blueprint $table) {
$table->id();
$table->foreignId('payment_id')->constrained('payments')->onDelete('cascade');
$table->enum('mounth', ['januari', 'februari', 'maret', 'april', 'mei', 'juni', 'juli', 'agustus', 'september', 'oktober', 'november', 'desember']);
$table->enum('status', ['bayar', 'belum bayar']);
$table->float('amount');
$table->float('penalty')->nullable();
$table->integer('bulan_pembayaran');
$table->integer('tahun_pembayaran');
$table->foreignId('type_id')->constrained('payment_types')->onDelete('cascade');
$table->timestamps();
});

View File

@ -5,6 +5,7 @@
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\SantriController;
use App\Http\Controllers\PaymentTypeController;
use App\Http\Controllers\PaymentController;
use Inertia\Inertia;
/*
@ -27,6 +28,7 @@
]);
});
// santri
Route::get('/data-santri', [SantriController::class, 'index'])->name('indexSantri');
Route::post('/addsantris', [SantriController::class, 'store'])->name('storeSantri');
Route::post('/updatesantris/{id}', [SantriController::class, 'update'])->name('updateSantri');
@ -38,6 +40,9 @@
Route::post('/updatepayment_types/{id}', [PaymentTypeController::class, 'update'])->name('updatePaymentType');
Route::post('/deletepayment_types/{id}', [PaymentTypeController::class, 'destroy'])->name('deletePaymentType');
// manual payment
Route::get('/manualPayment', [PaymentController::class, 'index'])->name('indexManualPayment');
Route::get('/dashboard', function () {
return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');