I have a controller App/Controllers/Api/Orders.php
Code:
<?php
namespace App\Controllers\Api;
use CodeIgniter\RESTful\ResourceController;
class Orders extends ResourceController
{
protected $modelName = 'App\Models\Order';
protected $format = 'json';
public function getIndex()
{
return $this->respond($this->model->findAll());
}
public function delete($id = null)
{
return $this->respond(['test' => 123]);
}
}
If I'm trying to access /api/orders/ with GET request it works fine (so auto routing is working).
I'm trying to send a DELETE request: /api/orders/15 however I'm getting error 404. What am I doing wrong?