I use the following route resource:
Route::apiResource('events', 'EventController');
EventController is:
public function update(UpdateEvent $request)
{
$model = Event::find($request->id)->update([
"name" => $request->name,
"date" => $request->date,
]);
return response()->json($model);
}
I send PUT request in JSON format to this endpoint /api/events.
Result error message is:
MethodNotAllowedHttpException
No message
So, I dont want pass id to url, I want transmit all data in PUT body request.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GJhP44
via IFTTT
Aucun commentaire:
Enregistrer un commentaire