Untitled

mail@pastecode.io avatar
unknown
php
a year ago
13 kB
4
Indexable
Never
<?php

use App\Http\Controllers\Api\v1\Admin\college\CollegeController;
use App\Http\Controllers\Api\v1\Admin\department\DepartmentController;
use App\Http\Controllers\Api\v1\Admin\StudentsController;
use App\Http\Controllers\Api\v1\Admin\User\UserController;
use App\Http\Controllers\web\dashboard\PlaceCategories\PlaceCategoryController;
use App\Http\Controllers\web\dashboard\PlaceItems\PlaceItemController;
use App\Http\Controllers\web\dashboard\Pos\PlaceController;
use App\Http\Controllers\web\dashboard\Pos\PosController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\v1\Auth\AuthController;
use App\Http\Controllers\web\dashboard\Accounting\TransactionsController;
use App\Http\Controllers\web\dashboard\Accounting\AccountsController;
use App\Http\Controllers\web\dashboard\Accounting\CategoriesController;
Route::middleware(['setDeviceToken'])->group(function () {
    Route::post('login', [AuthController::class, 'login'])->name('web.login');
});

Route::middleware(['auth:web', 'user.access.web', 'setDeviceToken', 'checkCookie'])->group(function () {
    Route::get('/',function (){
        return redirect()->route('dashboard.students.index');
    });
    Route::get('/students/import-from-excel', [\App\Http\Controllers\web\dashboard\Student\StudentsController::class, 'importFromExcel'])->name('dashboard.students.importExcel');
    Route::post('students/import', [StudentsController::class, 'importFromExcel'])->name('dashboard.students.importFromExcel');
    Route::post('students/export', [StudentsController::class, 'exportToExcel'])->name('dashboard.students.exportToExcel');
    Route::post('students/excel-parse', [StudentsController::class, 'parseExcelFile'])->name('dashboard.students.parseExcel');
    Route::get('/students/search', [\App\Http\Controllers\web\dashboard\Student\StudentsController::class,'search'])->name('dashboard.students.search');
    Route::post('/students/search', [\App\Http\Controllers\web\dashboard\Student\StudentsController::class,'getSearchResult'])->name('dashboard.students.searchResult');
    Route::post('/students/filter', [\App\Http\Controllers\web\dashboard\Student\StudentsController::class,'filter'])->name('dashboard.students.filter');
    Route::resource('/students', \App\Http\Controllers\web\dashboard\Student\StudentsController::class, ['names' => 'dashboard.students'])->only(['index','create','show']);


    Route::post('users/setRole', [UserController::class, 'setRole'])->name('dashboard.user.giveRoleToUser');
    Route::post('users/changePassword', [UserController::class, 'changePassword'])->name('dashboard.user.changePassword');
    Route::post('users/changePincode', [UserController::class, 'changePincode'])->name('dashboard.user.changePincode');
    Route::post('users', [UserController::class, 'store'])->name('dashboard.user.store');
    Route::put('users/{id}', [UserController::class, 'update'])->name('dashboard.user.update');

    Route::get('accounting/transactions', [\App\Http\Controllers\web\dashboard\Accounting\AccountingController::class, 'index'])->name('dashboard.accounting.transactions');
    Route::get('accounting/invoice', [\App\Http\Controllers\web\dashboard\Accounting\AccountingController::class, 'showInvoice'])->name('dashboard.accounting.showInvoice');
    Route::get('system-settings', [\App\Http\Controllers\web\dashboard\Setting\SystemSettingController::class, 'index'])->name('dashboard.settings.index');
    Route::get('my-profile', [\App\Http\Controllers\web\dashboard\MyProfile\MyProfileController::class, 'index'])->name('dashboard.profile.index');
    Route::get('my-settings', [\App\Http\Controllers\web\dashboard\MySettings\MySettingsController::class, 'index'])->name('dashboard.mySettings.index');
    Route::get('permissions', [\App\Http\Controllers\web\dashboard\Permissions\PermissionsController::class, 'index'])->name('dashboard.permissions.index');
    Route::get('permissions/create', [\App\Http\Controllers\web\dashboard\Permissions\PermissionsController::class, 'create'])->name('dashboard.permissions.create');
    Route::post('permissions', [\App\Http\Controllers\web\dashboard\Permissions\PermissionsController::class, 'store'])->name('dashboard.permissions.store');

    Route::get('pos', [PosController::class, 'index'])->name('dashboard.pos.index');
    Route::resource('places', PlaceController::class);
    Route::resource('place-categories', PlaceCategoryController::class);
    Route::resource('place-items', PlaceItemController::class);
    Route::resource('/hr/employees', \App\Http\Controllers\web\dashboard\HR\HrController::class, ['names' => 'dashboard.employees']);
    Route::post('/employees/search', [\App\Http\Controllers\web\dashboard\HR\HrController::class,'getSearchResult'])->name('dashboard.employees.searchResult');
    Route::get('/hr/attendance', [\App\Http\Controllers\web\dashboard\HR\HrController::class, 'attendanceView'])->name('dashboard.hr.attendance.index');
    Route::get('/hr/attendance/settings', [\App\Http\Controllers\web\dashboard\HR\HrController::class, 'attendanceSettingsView'])->name('dashboard.hr.attendance.settings');
    Route::post('logout', [AuthController::class, 'logout'])->name('web.logout');

    Route::prefix('/colleges')->group(function () {
        Route::get('/', [CollegeController::class, 'index'])->name('dashboard.colleges.index');
        Route::get('/{id}', [CollegeController::class, 'getById'])->name('dashboard.colleges.getById');
        Route::delete('/{id}', [CollegeController::class, 'delete'])->name('dashboard.colleges.delete');
        Route::post('/', [CollegeController::class, 'store'])->name('dashboard.colleges.store');
        Route::put('/{id}', [CollegeController::class, 'update'])->name('dashboard.colleges.update');
        Route::get('/{id}/departments', [CollegeController::class, 'getDepartments'])->name('dashboard.colleges.getDepartments');
    });

    Route::prefix('/departments')->group(function () {
        Route::get('/', [DepartmentController::class, 'index'])->name('dashboard.departments.index');
        Route::get('/{id}', [DepartmentController::class, 'getById'])->name('dashboard.departments.getById');
        Route::delete('/{id}', [DepartmentController::class, 'delete'])->name('dashboard.departments.delete');
        Route::post('/', [DepartmentController::class, 'store'])->name('dashboard.departments.store');
        Route::put('/{id}', [DepartmentController::class, 'update'])->name('dashboard.departments.update');
    });

    Route::prefix('/cities')->group(function () {
        Route::get('/', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'index'])->name('dashboard.cities.index');
        Route::get('/{id}', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'getById'])->name('dashboard.cities.getById');
        Route::delete('/{id}', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'delete'])->name('dashboard.cities.delete');
        Route::post('/', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'store'])->name('dashboard.cities.store');
        Route::put('/{id}', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'update'])->name('dashboard.cities.update');
        Route::get('/{id}/provinces', [\App\Http\Controllers\web\dashboard\City\CityController::class, 'provinces'])->name('dashboard.cities.getProvinces');
    });

    Route::prefix('/provinces')->group(function () {
        Route::get('/', [\App\Http\Controllers\web\dashboard\Province\ProvinceController::class, 'index'])->name('dashboard.provinces.index');
        Route::get('/{id}', [\App\Http\Controllers\web\dashboard\Province\ProvinceController::class, 'getById'])->name('dashboard.provinces.getById');
        Route::delete('/{id}', [\App\Http\Controllers\web\dashboard\Province\ProvinceController::class, 'delete'])->name('dashboard.provinces.delete');
        Route::post('/', [\App\Http\Controllers\web\dashboard\Province\ProvinceController::class, 'store'])->name('dashboard.provinces.store');
        Route::put('/{id}', [\App\Http\Controllers\web\dashboard\Province\ProvinceController::class, 'update'])->name('dashboard.provinces.update');
    });

    Route::prefix('healthConditions')->group(function () {
        Route::get('/', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'index'])->name('dashboard.healthConditions.index');
        Route::get('/{id}', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'getById'])->name('dashboard.healthConditions.getById');
        Route::delete('/{id}', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'delete'])->name('dashboard.healthConditions.delete');
        Route::post('/', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'store'])->name('dashboard.healthConditions.store');
        Route::put('/{id}', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'update'])->name('dashboard.healthConditions.update');
        Route::get('/{id}/types', [\App\Http\Controllers\web\dashboard\HealthCondition\HealtConditionController::class, 'types'])->name('dashboard.healthConditions.getTypes');
    });


    Route::get('categories', [CategoriesController::class, 'index'])->name('dashboard.categories.index');
    Route::post('categories/', [CategoriesController::class, 'store'])->name('dashboard.categories.store');
    Route::put('categories/{id}', [CategoriesController::class, 'update'])->name('dashboard.categories.update');
    Route::get('categories/{id}', [CategoriesController::class, 'getById'])->name('dashboard.categories.getById');
    Route::delete('categories/{id}', [CategoriesController::class, 'delete'])->name('dashboard.categories.delete');
    Route::get('categories/{id}/parent', [CategoriesController::class, 'parent'])->name('dashboard.categories.parent');
    Route::get('categories/{id}/children', [CategoriesController::class, 'children'])->name('dashboard.categories.children');
    Route::get('categories/{id}/accounts', [CategoriesController::class, 'accounts'])->name('dashboard.categories.accounts');
    Route::get('categories/{id}/transactions', [CategoriesController::class, 'transactions'])->name('dashboard.categories.getAllCategoryTransactions');

    Route::prefix('/accounts')->group(function () {
        Route::get('/', [AccountsController::class, 'index'])->name('dashboard.accounts.index');
        Route::post('/', [AccountsController::class, 'store'])->name('dashboard.accounts.store');
        Route::put('/{id}', [AccountsController::class, 'update'])->name('dashboard.accounts.update');
        Route::get('/{id}', [AccountsController::class, 'getById'])->name('dashboard.accounts.getById');
        Route::delete('/{id}', [AccountsController::class, 'delete'])->name('dashboard.accounts.delete');
        Route::get('/{id}/category', [AccountsController::class, 'category'])->name('dashboard.accounts.category');
    });
    
    Route::get('transactions/indebted-total', [TransactionsController::class, 'totalIndebted'])->name('dashboard.transactions.totalIndebted');
    Route::get('transactions/creditor-total', [TransactionsController::class, 'totalCreditor'])->name('dashboard.transactions.totalCreditor');
    Route::post('transactions/search', [TransactionsController::class, 'search'])->name('dashboard.transactions.search');
    Route::post('transactions/filter', [TransactionsController::class, 'filter'])->name('dashboard.transactions.filter');
    Route::get('transactions/', [TransactionsController::class, 'index'])->name('dashboard.transactions.index');
    Route::post('transactions/', [TransactionsController::class, 'store'])->name('dashboard.transactions.store');
    Route::post('transactions/receive-cash', [TransactionsController::class, 'receiveCash'])->name('dashboard.transactions.receiveCash');
    Route::put('transactions/{id}', [TransactionsController::class, 'update'])->name('dashboard.transactions.update');
    Route::get('transactions/{id}', [TransactionsController::class, 'getById'])->name('dashboard.transactions.getById');
    Route::delete('transactions/{id}', [TransactionsController::class, 'delete'])->name('dashboard.transactions.delete');
    Route::get('transactions/{id}/account-from', [TransactionsController::class, 'accountFrom'])->name('dashboard.transactions.accountFrom');
    Route::get('transactions/{id}/account-to', [TransactionsController::class, 'accountTo'])->name('dashboard.transactions.accountTo');
    Route::post('transactionType', [\App\Http\Controllers\Api\v1\Admin\TransactionType\TransactionTypeController::class, 'store'])->name('dashboard.transactionTypes.store');
});