commit
9d61f551ba
|
@ -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',
|
||||
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue