Hello,
so I'm currently dealing with a problem regarding my API. As I said when I'm trying to send PATCH request it fails, and the blame is on my column named class_type_id.
So I tried to dd the request it's getting. I found this.
array:2 [▼ // app\Http\Controllers\Api\V1\SiClassController.php:60
"letter" => "a"
"class_type_id" => null
]
Error is here:
{
"message": "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'class_type_id' cannot be null (Connection: mysql, SQL: update `si_classes` set `letter` = tpg, `class_type_id` = ? where `id` = 9b0b862a-1378-41ea-9ac2-02cf5795aef7)",
"exception": "Illuminate\\Database\\QueryException",
//...
}
My request looks like this:
PATCH /api/v1/classes/9b0b862a-1378-41ea-9ac2-02cf5795aef7 HTTP/1.1
Cookie: XSRF-...
Content-Type: application/json
Accept: application/json
Host: 127.0.0.1:8000
Content-Length: 20
{
"letter": "a"
}