You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Create a new event * * This endpoint is used to create a new event. * * @authenticated * * @bodyParam media file required The cover image of the event. * @bodyParam title string required The title of the event. Example: My Event * @bodyParam description string required The description of the event. Example: This is an event * @bodyParam start_date date required The start date of the event. Example: 27-11-2024 10:00 * @bodyParam end_date date required The end date of the event. Example: 27-11-2024 12:00 * @bodyParam schedules object[] The schedules of the event. * @bodyParam schedules[].date date required The date of the schedule. Example: 27-11-2024 10:00 * @bodyParam schedules[].detail string required The detail of the schedule. Example: This is a schedule */publicfunctionstore(Request$request): JsonResponse
{
$data = $request->validate([
'media' => 'required|file|mimes:jpeg,png,jpg|max:2048',
'title' => 'required|string|max:255',
'description' => 'required|string',
'start_date' => 'required|date_format:d-m-Y H:i',
'end_date' => 'required|date_format:d-m-Y H:i',
'schedules' => 'nullable|array',
'schedules.*.date' => 'required|date_format:d-m-Y H:i',
'schedules.*.detail' => 'required|string'
]);
}
For the above, Content-Type: multipart/form-data When i click on Send Request it sending schedules_0_date: 27-11-2024 10:00 and schedules_0_detail: 'This is a schedule'.
It should be send as schedules: [{ date: "27-11-2024 10:00" detail: "This is a schedule" }]
In that case, the rest of the request body would be sent as form data (eg a=b&c=d). Can you share a screenshot of what is actually sent (browser DevTools)?
Scribe version
4.38.0
PHP version
8.2.12
Framework
Laravel
Framework version
11.31
Scribe config
What happened?
For the above,
Content-Type: multipart/form-data
When i click onSend Request
it sendingschedules_0_date: 27-11-2024 10:00
andschedules_0_detail: 'This is a schedule'
.It should be send as
schedules: [{ date: "27-11-2024 10:00" detail: "This is a schedule" }]
Docs
The text was updated successfully, but these errors were encountered: