How Laravel locates a module
In backend-edusystems, a domain’s routes usually live in app/Modules/<module>/routes/api.php. The ModulesRouteServiceProvider loads these files with the api prefix and the api middleware group. Shared request, table and access code also lives outside the modules, including under app/Http and app/Repositories. To trace a page, find the address and HTTP method in its frontend service and locate that specific operation in the server routes. Frontend architecture
A learning plan list read, step by step
| Stage | What happens when the user opens the list |
|---|---|
| Route | GET /api/learning-plan maps to the named action learning-plan.index. The module routes connect the resource to its controller and declare the faculty and profession scopes. |
| Access | The protected API checks the Sanctum session, account activation and route permission. For routes declaring scopes, the action’s context contributes to visibility. Learning plan model restrictions use the faculty and profession fields. |
| Input | LearningPlanFilterRequest defines filters for year, degree, learning format, faculty, profession and education sector. Faculty depends on degree and format. Profession also depends on faculty and sector. These selections determine the slice requested. |
| Data retrieval | LearningPlanController::index passes the request to the table repository. The repository queries models and handles sorting. The plan’s education sector comes through its profession. |
| Response | LearningPlanResource returns identifiers, translated catalog values, duration, computed active course and approval information. Requests specifying a page size receive data, pagination and schema. Without a page size the available collection and schema are returned. Check each endpoint’s own response contract. |
A successful response with empty data means the query completed with no rows in the returned selection. Check filters, current page and the user’s permitted scopes. See Roles and Action permissions for assignments and access rules.
What happens when creating a plan
- The list form submits the plan to
POST /api/learning-plan. The save request checks for a numeric duration up to 15, consistency between the profession, learning format, degree and faculty, and an education sector on the chosen profession. Scope validation uses the submitted faculty and profession. - The controller checks for a match on year, degree, format, faculty and profession, including soft-deleted records. A match returns
409with a different message for an active record and a deleted record. - For a new plan, the controller writes the model and runs student synchronization within a transaction. Copying also invokes the service that clones the source plan structure. A successful ordinary creation returns
201and the new record. Empty calendar weeks are created on demand when an educational symbol is assigned. - Editing additionally checks the user’s permission to change the specific record. The route group enforces approval locks. Reloading the page does not change the record’s approval state or the user’s permissions.
Interpreting an example response
A coordinator creates an Informatics bachelor’s plan for the 2026/27 intake and receives a conflict with a deleted plan. Validation progressed to the uniqueness check. Find the existing record in the deleted items list and compare its year, degree, format, faculty and profession. Restore it through the normal action if it is the required plan and the user has restoration permission. A different duration leaves the same unique combination in place. Learning plans · Restoring a plan · Troubleshooting
Implementation references
- frontend-edusystems · LearningPlan/LearningPlanService.ts
- backend-edusystems · Providers/ModulesRouteServiceProvider.php
- backend-edusystems · bootstrap/app.php
- backend-edusystems · Middleware/CheckRoutePermission.php
- backend-edusystems · routes/api.php
- backend-edusystems · Requests/LearningPlanFilterRequest.php
- backend-edusystems · Requests/LearningPlanRequest.php
- backend-edusystems · Controllers/LearningPlanController.php
- backend-edusystems · Models/LearningPlan.php
- backend-edusystems · Repositories/LearningPlanTableRepository.php
- backend-edusystems · Resources/LearningPlanResource.php
- backend-edusystems · Services/LearningPlanService.php
- backend-edusystems · Concerns/RespondsWithTableIndex.php