121 lines
6.0 KiB
PHP
121 lines
6.0 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Authentication\AuthController;
|
|
use App\Http\Controllers\DashboardController;
|
|
use App\Http\Controllers\MasterData\BarangController;
|
|
use App\Http\Controllers\MasterData\SupplierController;
|
|
use App\Http\Controllers\MasterData\KategoriController;
|
|
use App\Http\Controllers\MasterData\LaporanController;
|
|
use App\Http\Controllers\MasterData\UserController;
|
|
use App\Http\Controllers\Transaction\PenjualanController;
|
|
use App\Http\Controllers\Transaction\PembelianController;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Facades\Response;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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::middleware(['guest'])->group(function () {
|
|
Route::controller(AuthController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'login')->name('login');
|
|
});
|
|
});
|
|
|
|
Route::middleware(['auth'])->group(function () {
|
|
Route::prefix('dashboard')->group(function () {
|
|
Route::controller(DashboardController::class)->group(function () {
|
|
Route::get('notification', 'getNotification')->name('notification');
|
|
Route::get('cetak', 'cetak')->name('dashboard.cetak');
|
|
Route::post('notification/{id}', 'updateNotification')->name('notification.update');
|
|
Route::get('/', 'index')->name('dashboard');
|
|
Route::post('/password', 'changePassword')->name('password.update');
|
|
Route::match(['GET', 'POST'], '/profile', 'profile')->name('profile');
|
|
Route::get('foto_user/{filename}', function ($filename) {
|
|
$path = storage_path('app/public/foto_user/' . $filename);
|
|
|
|
if (!file_exists($path)) {
|
|
abort(404);
|
|
}
|
|
|
|
return response()->file($path);
|
|
})->name('foto_user');
|
|
});
|
|
Route::controller(AuthController::class)->group(function () {
|
|
Route::get('logout', 'logout')->name('logout');
|
|
});
|
|
Route::prefix('master/data')->group(function () {
|
|
Route::prefix('user')->group(function () {
|
|
Route::controller(UserController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('user');
|
|
Route::match(['GET', 'POST'], '/update/{id}', 'update')->name('user.update');
|
|
Route::match(['GET'], '/delete/{id}', 'delete')->name('user.delete');
|
|
});
|
|
});
|
|
Route::prefix('barang')->group(function () {
|
|
Route::controller(BarangController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('barang');
|
|
Route::match(['GET', 'POST'], '/update/{id}', 'update')->name('barang.update');
|
|
Route::match(['GET'], '/delete/{id}', 'delete')->name('barang.delete');
|
|
Route::match(['GET'], '/qrcode/{kode}', 'generateQR')->name('barang.qrcode');
|
|
Route::get('/scan/{kode}', 'findBarcode')->name('barang.scan');
|
|
|
|
Route::get('qrcode/{filename}', function ($filename) {
|
|
$path = storage_path('app/public/qrcodes/' . $filename);
|
|
|
|
if (!file_exists($path)) {
|
|
abort(404);
|
|
}
|
|
|
|
return response()->file($path);
|
|
})->name('qrcode');
|
|
});
|
|
});
|
|
Route::prefix('kategori')->group(function () {
|
|
Route::controller(KategoriController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('kategori');
|
|
Route::match(['GET', 'POST'], '/update/{id}', 'update')->name('kategori.update');
|
|
Route::match(['GET'], '/delete/{id}', 'delete')->name('kategori.delete');
|
|
});
|
|
});
|
|
Route::prefix('laporan')->group(function () {
|
|
Route::controller(LaporanController::class)->group(function () {
|
|
Route::match(['GET'], 'harian', 'laporanHarian')->name('laporan.harian');
|
|
Route::match(['GET'], 'bulanan', 'laporanBulanan')->name('laporan.bulanan');
|
|
Route::match(['GET'], 'pembayaran', 'laporanPembayaran')->name('laporan.pembayaran');
|
|
});
|
|
});
|
|
});
|
|
Route::prefix('penjualan')->group(function () {
|
|
Route::controller(PenjualanController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('penjualan');
|
|
Route::get('/print', 'print')->name('penjualan.print');
|
|
});
|
|
});
|
|
Route::prefix('pembelian')->group(function () {
|
|
Route::controller(PembelianController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('pembelian');
|
|
Route::match(['GET', 'POST'], '/tambah', 'tambah')->name('pembelian.tambah');
|
|
Route::match(['GET'], '/delete/{id}', 'delete')->name('pembelian.delete');
|
|
Route::get('/print', 'print')->name('pembelian.print');
|
|
});
|
|
});
|
|
Route::prefix('supplier')->group(function () {
|
|
Route::controller(SupplierController::class)->group(function () {
|
|
Route::match(['GET', 'POST'], '/', 'index')->name('supplier');
|
|
Route::match(['GET', 'POST'], '/update/{id}', 'update')->name('supplier.update');
|
|
Route::match(['GET'], '/delete/{id}', 'delete')->name('supplier.delete');
|
|
|
|
|
|
});
|
|
});
|
|
});
|
|
}); |