initial project
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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'
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user