/home/awneajlw/.trash/routes.2/web.php
<?php
use App\Models\Subscribe;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Session;
use App\Http\Controllers\Frontend\frontend;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\ZakatController;
use App\Http\Controllers\Admin\BranchController;
use App\Http\Controllers\SubAdmin\SaleController;
use App\Http\Controllers\Admin\InventoryController;
use App\Http\Controllers\Admin\SubscribeController;
use App\Http\Controllers\SubAdmin\SubUserController;
use App\Http\Controllers\Frontend\frontendController;
use App\Http\Controllers\SubAdmin\AttendanceController;
use App\Http\Controllers\SubAdmin\SubInventoryController;
use App\Http\Controllers\Admin\InventoryCategoryController;
use App\Http\Controllers\SuperAdmin\SaleController as SuperAdminSaleController;
Route::get('/optimize', function() {
Artisan::call('optimize');
return "optimized!";
});
// routes/web.php
Route::get('lang/{locale}', function ($locale) {
Session::put('locale', $locale);
return redirect()->back();
})->name('setLanguage');
// Route::redirect('/', '/dashboard');
Route::get('/', [frontendController::class, 'index'])->name('home');
Route::post('/save-subscribe', [frontendController::class, 'saveSubscribe'])->name('save.subscribe');
Route::get('/service1', function() {
return view('frontend.services.service1');
});
Route::get('/service2', function() {
return view('frontend.services.service2');
});
Route::get('/service3', function() {
return view('frontend.services.service3');
});
Route::get('/service4', function() {
return view('frontend.services.service4');
});
Route::get('/service5', function() {
return view('frontend.services.service5');
});
Route::get('/service6', function() {
return view('frontend.services.service6');
});
Route::get('/service7', function() {
return view('frontend.services.service7');
});
Route::get('/service8', function() {
return view('frontend.services.service8');
});
Route::get('register', [AuthController::class, 'registerPage'])->name('register');
Route::post('register', [AuthController::class, 'register'])->name('register.post');
Route::get('login', [AuthController::class, 'loginPage'])->name('login');
Route::post('login', [AuthController::class, 'login'])->name('login.post');
Route::middleware(['auth'])->group(function () {
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
Route::get('/dashboard', [AuthController::class, 'dashboard'])->name('dashboard');
Route::get('/all-branch-sales', [SaleController::class, 'allBranchSales'])->name('branch.allSales');
//================ subscribe
Route::get('/subscribe', [SubscribeController::class, 'index'])->name('Subscribe');
Route::get('/subscribe-list', [SubscribeController::class, 'getSubscribe'])->name('subscribe.list');
Route::get('/update-subscribe/{id}', [SubscribeController::class, 'updateSubscribe'])->name('updateSubscribe');
//================ user
Route::get('/user', [UserController::class, 'index'])->name('user');
Route::get('/users-list', [UserController::class, 'getUsers'])->name('user.list');
// add user
Route::post('/add-user', [UserController::class, 'addUser'])->name('user.add');
// edit user
Route::get('/edit-user/{id}', [UserController::class, 'editUser'])->name('user.edit');
// update user
Route::get('/update-user', [UserController::class, 'updateUser'])->name('user.update');
// user delete
Route::get('/user-delete/{id}', [UserController::class, 'deleteUser'])->name('user.delete');
// profile user
Route::get('/profile-user', [UserController::class, 'profileUser'])->name('user.profile');
// detail user
Route::post('/user-detail', [UserController::class, 'userDetail'])->name('user.detail');
//================ branch
Route::get('/branch', [BranchController::class, 'index'])->name('branch');
// change the user to branch
Route::get('/branch-inventory-list', [BranchController::class, 'getBranchInventory'])->name('Branchinventory.list');
Route::get('/branch-sale-list', [BranchController::class, 'getBranchSale'])->name('Branchsale.list');
Route::get('/branches-list', [BranchController::class, 'getBranch'])->name('branch.list');
// add branch
Route::post('/add-branch', [BranchController::class, 'addBranch'])->name('branch.add');
// detail branch
Route::get('/branch-detail/{id}', [BranchController::class, 'detailBranch'])->name('branch.detail');
// edit branch
Route::get('/edit-branch/{id}', [BranchController::class, 'editBranch'])->name('branch.edit');
// update branch
Route::get('/update-branch', [BranchController::class, 'updateBranch'])->name('branch.update');
// branch delete
Route::get('/branch-delete/{id}',[BranchController::class, 'deleteBranch'])->name('branch.delete');
//================ Inventory
Route::get('/inventory', [InventoryController::class, 'index'])->name('inventory');
// change the Inventory
Route::get('/inventory-list', [InventoryController::class, 'getInventory'])->name('inventory.list');
// add
Route::post('/add-inventory', [InventoryController::class, 'addinventory'])->name('inventory.add');
// // edit
Route::get('/edit-inventory/{id}',[InventoryController::class, 'editinventory'])->name('inventory.edit');
// // update
Route::post('/update-inventory', [InventoryController::class, 'updateinventory'])->name('inventory.update');
Route::get('/inventory-delete/{id}', [InventoryController::class, 'deleteinventory'])->name('inventory.delete');
//================ Inventory Category
Route::get('/inventoryCategory', [InventoryCategoryController::class, 'index'])->name('CAtegory');
// change the InventoryCategory
Route::get('/inventoryCategory-list', [InventoryCategoryController::class, 'getInventoryCategory'])->name('inventoryCategory.list');
// add branch
Route::post('/add-inventoryCategory', [InventoryCategoryController::class, 'addinventoryCategory'])->name('inventoryCategory.add');
// // edit branch
Route::get('/edit-inventoryCategory/{id}',[InventoryCategoryController::class, 'editinventoryCategory'])->name('inventoryCategory.edit');
// // update branch
Route::post('/update-inventoryCategory', [InventoryCategoryController::class, 'updateinventoryCategory'])->name('inventoryCategory.update');
Route::get('/inventoryCategory-delete/{id}', [InventoryCategoryController::class, 'deleteinventoryCategory'])->name('inventoryCategory.delete');
// --------------=========Sub Admin
Route::get('/sales', [SaleController::class, 'index'])->name('sale.index');
Route::get('/invoice/{sale}', [SaleController::class, 'show'])->name('invoice.show');
Route::post('/sales', [SaleController::class, 'store'])->name('sales.store');
// =================== user attendance
// index
Route::get('/user-attendance', [AttendanceController::class,'index'])->name('user-attandace');
// load user data
Route::get('/user-dashboard-data', [AttendanceController::class,'loadData'])->name('load-data');
//================ Inventory
Route::get('/sub-inventory', [SubInventoryController::class, 'index'])->name('subinventory');
// change the Inventory
Route::get('/sub-inventory-list', [SubInventoryController::class, 'getInventory'])->name('subinventory.list');
// add
Route::post('/sub-add-inventory', [SubInventoryController::class, 'addinventory'])->name('subinventory.add');
// // edit
Route::get('/sub-edit-inventory/{id}',[SubInventoryController::class, 'editinventory'])->name('subinventory.edit');
// // update
Route::post('/sub-update-inventory', [SubInventoryController::class, 'updateinventory'])->name('subinventory.update');
Route::get('/sub-inventory-delete/{id}', [SubInventoryController::class, 'deleteinventory'])->name('subinventory.delete');
//================ user
Route::get('/sub-user', [SubUserController::class, 'index'])->name('sub-user');
Route::get('/sub-users-list', [SubUserController::class, 'getUsers'])->name('sub-user.list');
// add user
Route::post('/sub-add-user', [SubUserController::class, 'addUser'])->name('sub-user.add');
// edit user
Route::get('/sub-edit-user/{id}', [SubUserController::class, 'editUser'])->name('sub-user.edit');
// update user
Route::get('/sub-update-user', [SubUserController::class, 'updateUser'])->name('sub-user.update');
// user delete
Route::get('/sub-user-delete/{id}', [SubUserController::class, 'deleteUser'])->name('sub-user.delete');
// --------------========= ZAKAT
Route::get('/zakat', [ZakatController::class, 'index'])->name('zakat.index');
Route::get('/zakat/{id}/edit', [ZakatController::class, 'edit'])->name('admin.zakat.edit');
Route::post('/zakat/{id}/update', [ZakatController::class, 'update'])->name('admin.zakat.update');
});