AMS_Backend/app/Controllers/Frontend/GrabController.php
2025-11-06 13:41:06 +08:00

34 lines
674 B
PHP

<?php
namespace App\Controllers\Frontend;
use App\Controllers\BaseController;
use CodeIgniter\API\ResponseTrait;
use App\Libraries\Grab;
use App\Models\LogGrab;
class GrabController extends BaseController
{
protected $grab;
use ResponseTrait;
public function __construct()
{
$this->grab = new Grab();
}
public function webhook()
{
$rawBody = file_get_contents('php://input');
$data = json_decode($rawBody, true);
if ($data) {
$this->grab->handleWebhook($data);
}
return $this->respond([
'status' => 200,
'message' => 'Webhook received'
]);
}
}