Aplikasi_Rekber/routes/web.php
2023-11-13 16:49:06 +07:00

206 lines
10 KiB
PHP

<?php
use App\Models\Refunds;
use App\Models\Transactions;
use Illuminate\Support\Facades\Route;
//Admin
use App\Http\Controllers\Login\LoginController;
use App\Http\Controllers\Admin\AdminUserController;
use App\Http\Controllers\User\UserRefundController;
//Login
use App\Http\Controllers\User\UserContactController;
use App\Http\Controllers\Admin\AdminRefundController;
//User
use App\Http\Controllers\Admin\AdminSettingController;
use App\Http\Controllers\User\UserDashboardController;
use App\Http\Controllers\Admin\AdminDashboardController;
use App\Http\Controllers\User\UserTransactionController;
use App\Http\Controllers\Admin\AdminTransactionController;
//Profile
use App\Http\Controllers\Profile\ProfileController;
//Invoice
use App\Http\Controllers\Invoice\InvoiceController;
// use Illuminate\Foundation\Auth\User;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/', function () {
return view('welcome'
);
});
Route::get('/detail_transaction', function () {
return view('admin/transaction/detail-transaction',[
'name'=>'Jilhn Haura',
'detail_transaction' => Transactions::allDetailTransactions()
]);
})->name('transaction.detail');
Route::get('/detail_refund',function() {
return view('admin/refund/detail-refund',[
'name'=>'Jilhan Haura',
"detail_refund"=> Refunds::DetailRefund()
]);
})->name('refund.detail');
Route::get('/next_detail_refund',function() {
return view('admin/refund/next-detail-refund',[
'name'=>"Jilhan Haura"
]);
});
//Index
// Login, logout dan register
Route::controller(LoginController::class)->group(function(){
Route::get('login','login')->name('login');
Route::get('logout','logout')->name('logout');
Route::post('authenticate','authenticate')->name('autentikasi');
Route::post('register','register')->name('register');
Route::get('cek-email','accountStatus')->name('status-akun');
Route::get('cari-provinsi','searchProvince')->name('cari-provinsi');
Route::get('cari-kota','searchCity')->name('cari-kota');
Route::get('cari-kecamatan','searchDistrict')->name('cari-kecamatan');
Route::get('cari-kelurahan','searchVillage')->name('cari-kelurahan');
Route::post('kode-verifikasi','sendVerificationCode')->name('kirim-kode');
Route::get('ocr','getOcr');
});
// admin dan user
Route::middleware(['auth'])->group(function(){
Route::prefix('profile')->group(function(){
Route::controller(ProfileController::class)->group(function(){
Route::get('/','index')->name('profile.index');
Route::post('update','updateProfile')->name('profile.update');
Route::put('ganti-password','changePassword')->name('profile.change-password');
});
});
Route::prefix('invoice')->group(function(){
Route::controller(InvoiceController::class)->group(function(){
Route::get('invoice/{id}','getInvoice')->name('invoice.get');
Route::get('export-invoice','exportInvoice')->name('invoice.export');
});
});
Route::middleware(['admin'])->group(function(){
Route::prefix('admin')->group(function(){
// Tampilan dashboard admin beserta perhitungan
Route::controller(AdminDashboardController::class)->group(function(){
Route::get('/','index')->name('admin.index');
});
// Tampilan, aprove atau deny dan hapus user
Route::controller(AdminUserController::class)->group(function(){
Route::get('admin-user','index')->name('admin-user.index');
Route::get('admin-user/list-user','listUser')->name('admin-user.list-user');
Route::get('admin-user/{id}','show')->name('admin-user.show');
Route::delete('admin-user/hapus-user','delete')->name('admin-user.destroy');
Route::put('admin-user/approve-user', 'approveUser')->name('admin-user.approve');
Route::put('admin-user/deny-user', 'denyUser')->name('admin-user.deny');
});
// Tampilan transaksi (Sudah)
Route::controller(AdminTransactionController::class)->group(function(){
Route::get('admin-transaction','index')->name('admin-transaction.index');
Route::get('admin-transaction/detail/{id}','show')->name('admin-transaction.show');
Route::get('admin-transaction/list-transaction','listTransaction')->name('admin-transaction.list-transaction');
Route::get('admin-transacion/transaction-tracking','transactionTracking')->name('admin.transaction-tracking');
Route::put('admin-transaction/accept-transaction','approveTransaction')->name('admin-transaction.accept-transaction');
Route::put('admin-transaction/deny-transaction','denyTransaction')->name('admin-transaction.deny-transaction');
});
// Tampilan, approve atau deny dan hapus refund
Route::controller(AdminRefundController::class)->group(function(){
Route::get('admin-refund','index')->name('admin-refund.index');
Route::get('admin-refund/list-refund','listRefund')->name('admin-refund.list-refund');
Route::get('admin-refund/{id}','show')->name('admin-refund.show');
Route::put('admin-refund/approve-refund','approveRefund')->name('admin-refund.approve');
Route::put('admin-refund/deny-refund','denyRefund')->name('admin-refund.deny');
});
// Tampilan, tambah, ubah dan hapus kebijakan persentase perusahaan
Route::controller(AdminSettingController::class)->group(function(){
Route::get('admin-setting','index')->name('admin-setting.index');
Route::get('admin-setting/list-setting','listSetting')->name('admin-setting.list-setting');
Route::post('admin-setting/store','store')->name('admin-setting.store');
Route::put('admin-setting/active/','activeSetting')->name('admin-setting.active-setting');
});
});
});
Route::middleware(['user'])->group(function(){
Route::prefix('user')->group(function(){
// Tampilan dashboard user beserta perhitungan
Route::controller(UserDashboardController::class)->group(function(){
Route::get('/','index')->name('user.index');
});
// Tampilan, tambah dan hapus kontak
Route::controller(UserContactController::class)->group(function(){
Route::get('user-contact','index')->name('user-contact.index');
Route::get('user-contact/list-contact','listContact')->name('user-contact.list-contact');
Route::post('user-contact','store')->name('user-contact.store');
Route::get('admin-contact/{id}','show')->name('admin-contact.show');
Route::delete('user-contact/delete','destroy')->name('user-contact.destroy');
Route::get('user-contact/get-user-contact','getContact')->name('user-contact.get');
Route::get('user-contact/cek-contact','cekEmail')->name('user-contact.email');
Route::get('user-contact/detailContact','detailContact')->name('user-contact.detail-contact');
});
// Tampilan transaksi, bayar, update status pengiriman dan refund
Route::controller(UserTransactionController::class)->group(function(){
// Pembeli
Route::get('user-pembeli','indexPembeli')->name('user-pembeli.index');
Route::get('user-pembeli/list-pembeli','listPembeli')->name('user-pembeli.list-pembeli');
Route::get('user-pembeli/detail-transaksi/{id}','show')->name('user-pembeli.show');
Route::get('user-pembeli/tambah-transaksi','create')->name('user-pembeli.create');
Route::post('user-pembeli','store')->name('user-pembeli.store');
Route::put('user-pembeli/bayar-transaksi','payTransaction')->name('user-pembeli.pay');
Route::put('user-pembeli/batal-transaksi','cancelTransaction')->name('user-pembeli.cancel');
Route::put('user-pembeli/transaksi-pending', 'pendingTransaction')->name('user-pembeli.pending');
Route::put('user-pembeli/transaksi-error','onErrorTransaction')->name('user-pembeli.error');
Route::put('user-pembeli/transaksi-close','onCloseTransaction')->name('user-pembeli.close');
Route::put('user-pembeli/transaksi-selesai','finishTransaction')->name('user-pembeli.finish');
Route::put('user-pembeli/transaksi-komplain/{id}','complaintTransaction')->name('user-pembeli.complain');
//Penjual
Route::get('user-penjual','indexPenjual')->name('user-penjual.index');
Route::get('user-penjual/list-penjual','listPenjual')->name('user-penjual.list-penjual');
Route::get('user-penjual/detail-transaksi/{id}','show')->name('user-penjual.show');
Route::get('user-penjual/tolak-transaksi','denyTransaction')->name('user-penjual.deny');
Route::put('user-penjual/terima-transaksi','acceptTransaction')->name('user-penjual.accept');
Route::put('user-penjual/kirim-pesanan','sendingOrder')->name('user-penjual.sending');
Route::post('user-penjual/selesai-kirim-pesanan','sentOrder')->name('user-penjual.sent');
Route::get('transaction-tracking','transactionTracking')->name('user.transaction-tracking');
});
// Tampilan refund
Route::controller(UserRefundController::class)->group(function(){
Route::get('user-refund','index')->name('user-refund.index');
Route::get('user-refund/list-refund','listRefund')->name('user-refund.list-refund');
Route::get('user-refund/ajukan-komplain/{id}','create')->name('user-refund.create');
Route::get('user-refund/detail-refund/{id}','show')->name('user-refund.show');
Route::post('user-refund','store')->name('user-refund.store');
});
});
});
});