group(function () { Route::get('employees/form/{element}', 'EmployeesAPIController@form'); Route::resource('employees', 'EmployeesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('employees/form/{element}', 'EmployeesAPIController@form'); Route::apiResource('employees', 'EmployeesAPIController'); }); // Public routes for employees Route::get('employee/Employees', 'EmployeesPublicController@getEmployees'); } ); } // API routes for benefits Route::prefix('{guard}/employee')->group(function () { Route::get('benefits/form/{element}', 'BenefitsAPIController@form'); Route::resource('benefits', 'BenefitsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('benefits/form/{element}', 'BenefitsAPIController@form'); Route::apiResource('benefits', 'BenefitsAPIController'); }); // Public routes for employees Route::get('employee/Benefits', 'BenefitsPublicController@getBenefits'); } ); } // API routes for dependents Route::prefix('{guard}/employee')->group(function () { Route::get('dependents/form/{element}', 'DependentsAPIController@form'); Route::resource('dependents', 'DependentsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('dependents/form/{element}', 'DependentsAPIController@form'); Route::apiResource('dependents', 'DependentsAPIController'); }); // Public routes for employees Route::get('employee/Dependents', 'DependentsPublicController@getDependents'); } ); } // API routes for leaves Route::prefix('{guard}/employee')->group(function () { Route::get('leaves/form/{element}', 'LeavesAPIController@form'); Route::resource('leaves', 'LeavesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('leaves/form/{element}', 'LeavesAPIController@form'); Route::apiResource('leaves', 'LeavesAPIController'); }); // Public routes for employees Route::get('employee/Leaves', 'LeavesPublicController@getLeaves'); } ); } // API routes for salary_history Route::prefix('{guard}/employee')->group(function () { Route::get('salary_history/form/{element}', 'SalaryHistoryAPIController@form'); Route::resource('salary_history', 'SalaryHistoryAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('salary_history/form/{element}', 'SalaryHistoryAPIController@form'); Route::apiResource('salary_history', 'SalaryHistoryAPIController'); }); // Public routes for employees Route::get('employee/SalaryHistory', 'SalaryHistoryPublicController@getSalaryHistory'); } ); } // API routes for attendance Route::prefix('{guard}/employee')->group(function () { Route::get('attendance/form/{element}', 'AttendanceAPIController@form'); Route::resource('attendance', 'AttendanceAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('attendance/form/{element}', 'AttendanceAPIController@form'); Route::apiResource('attendance', 'AttendanceAPIController'); }); // Public routes for employees Route::get('employee/Attendance', 'AttendancePublicController@getAttendance'); } ); } // API routes for newjoinee Route::prefix('{guard}/employee')->group(function () { Route::get('newjoinee/form/{element}', 'NewjoineeAPIController@form'); Route::resource('newjoinee', 'NewjoineeAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for employees Route::prefix('{guard}/employee')->group(function () { Route::get('newjoinee/form/{element}', 'NewjoineeAPIController@form'); Route::apiResource('newjoinee', 'NewjoineeAPIController'); }); // Public routes for employees Route::get('employee/Newjoinee', 'NewjoineePublicController@getNewjoinee'); } ); }