group(function () { Route::resource('employees', 'EmployeesResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'EmployeesResourceController'); }); // Public routes for pages Route::get('employees/', 'EmployeesPublicController@index'); Route::get('employees/{slug?}', 'EmployeesPublicController@show'); } ); } // web routes for benefits Route::prefix('{guard}/employee')->group(function () { Route::resource('benefits', 'BenefitsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'BenefitsResourceController'); }); // Public routes for pages Route::get('employees/', 'BenefitsPublicController@index'); Route::get('employees/{slug?}', 'BenefitsPublicController@show'); } ); } // web routes for dependents Route::prefix('{guard}/employee')->group(function () { Route::resource('dependents', 'DependentsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'DependentsResourceController'); }); // Public routes for pages Route::get('employees/', 'DependentsPublicController@index'); Route::get('employees/{slug?}', 'DependentsPublicController@show'); } ); } // web routes for leaves Route::prefix('{guard}/employee')->group(function () { Route::resource('leaves', 'LeavesResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'LeavesResourceController'); }); // Public routes for pages Route::get('employees/', 'LeavesPublicController@index'); Route::get('employees/{slug?}', 'LeavesPublicController@show'); } ); } // web routes for salary_history Route::prefix('{guard}/employee')->group(function () { Route::resource('salary_history', 'SalaryHistoryResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'SalaryHistoryResourceController'); }); // Public routes for pages Route::get('employees/', 'SalaryHistoryPublicController@index'); Route::get('employees/{slug?}', 'SalaryHistoryPublicController@show'); } ); } // web routes for attendance Route::prefix('{guard}/employee')->group(function () { Route::resource('attendance', 'AttendanceResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'AttendanceResourceController'); }); // Public routes for pages Route::get('employees/', 'AttendancePublicController@index'); Route::get('employees/{slug?}', 'AttendancePublicController@show'); } ); } // web routes for newjoinee Route::prefix('{guard}/employee')->group(function () { Route::resource('newjoinee', 'NewjoineeResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'NewjoineeResourceController'); }); // Public routes for pages Route::get('employees/', 'NewjoineePublicController@index'); Route::get('employees/{slug?}', 'NewjoineePublicController@show'); } ); }