Merhaba,
Bir api oluşturmaya çalışıyorum.
routes içerisindeki api.php'de aşağıdaki satır ekli:
Route::apiResource('categories', 'CategoriesController');CategoriesController'da store metodunun içerisi aşağıdaki şekilde:
public function store(Request $request)
{
$id = DB::table('categories')->insertGetId(
array(
'slug' => $request->slug,
'name' => $request->name
)
);
if (!empty($id)) {
$response = array('response' => 'Başarılı');
}else {
$response = array('response' => 'Başarısız');
}
return response()->json($response);
}Lakin postman üzerinden istek attığımda request içerisindeki slug ve name'in null değer döndürdüğünü görüyorum.
Bunun nedeni ne olabilir...