31 lines
732 B
PHP
31 lines
732 B
PHP
<?php
|
|
namespace App\Controllers;
|
|
|
|
use App\Helpers\Response;
|
|
use App\Models\Service;
|
|
|
|
/**
|
|
* Class ServiceController
|
|
* Massage Services & Packages REST API Controller
|
|
*
|
|
* @package App\Controllers
|
|
*/
|
|
class ServiceController
|
|
{
|
|
private Service $serviceModel;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->serviceModel = new Service();
|
|
}
|
|
|
|
/**
|
|
* GET /api/v1/services - Get active services
|
|
*/
|
|
public function index(): void
|
|
{
|
|
$branchId = isset($_GET['branch_id']) ? (int)$_GET['branch_id'] : null;
|
|
Response::success('รายการบริการและคอร์สนวดแผนไทยทั้งหมด', $this->serviceModel->getActive($branchId));
|
|
}
|
|
}
|