Viewing File: /home/assersoft/public_html/doctor-assistant/app/Config/Routes.php

<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');
$routes->get('/user/activate/(:segment)', 'UsersController::activate/$1');
$routes->get('/user/reset-password/(:segment)', 'UsersController::reset/$1');
$routes->post('/user/reset-password/(:segment)', 'UsersController::reset/$1');

// Users Routes
$routes->resource("users", ['controller' => 'UsersController']);
$routes->group("users", function($routes) {
    $routes->post("login", 'UsersController::login');
    $routes->post("refresh", 'UsersController::refresh');
    $routes->post("logout", 'UsersController::logout');
    $routes->post("reset-password", 'UsersController::resetPassword');
    $routes->post("register", 'UsersController::create');
});

// Patients Routes
$routes->resource("patients", ['controller' => 'PatientsController']);
$routes->group("patients", function($routes) {
    $routes->get("search-by-phone", 'PatientsController::search');
});

// Treatment Routes
$routes->resource("treatments", ['controller' => 'TreatmentsController']);

// Appointments Routes
$routes->group("appointments", function($routes) {
    $routes->get("find-by-date", 'AppointmentsController::findByDate');
    $routes->get("find-by-doctor", 'AppointmentsController::findByDoctor');
    $routes->get("find-by-doctor-and-date", 'AppointmentsController::findByDoctorAndDate');
    $routes->get("find-by-status", 'AppointmentsController::findByStatus');
    $routes->get("find-by-date-and-status", 'AppointmentsController::findByStatusAndDate');
    $routes->get("find-by-treatment", 'AppointmentsController::findByTreatment');
});
$routes->resource("appointments", ['controller' => 'AppointmentsController']);

// Clinics Routes
$routes->resource("clinics", ['controller' => 'ClinicsController']);
$routes->group("clinics", ['filter' => App\Filters\ProviderFilter::class], function($routes) {
    $routes->group("(:num)/subscriptions", function($routes) {
        $routes->get("", 'ClinicsController::getSubscriptions');
        $routes->post("", 'ClinicsController::renewSubscription');
        $routes->get("(:num1)", 'ClinicsController::findSubscriptionById');
        $routes->put("(:num1)", 'ClinicsController::cancelSubscription');
        $routes->patch("(:num1)", 'ClinicsController::cancelSubscription');
        $routes->delete("(:num1)", 'ClinicsController::deleteSubscription');
    });
});
Back to Directory File Manager