There is no validation in the good version so $request->validated() will be empty....
Section copied below for context
bad
public function update(Request $request): string
{
$validated = $request->validate([
'title' => 'required|max:255',
'events' => 'required|array:date,type'
]);
foreach ($request->events as $event) {
$date = $this->carbon->parse($event['date'])->toString();
$this->logger->log('Update event ' . $date . ' :: ' . $);
}
$this->event->updateGeneralEvent($request->validated());
return back();
}
good
public function update(UpdateRequest $request): string
{
/* MISSING VALIDATION HERE */
$this->logService->logEvents($request->events);
$this->event->updateGeneralEvent($request->validated());
return back();
}
There is no validation in the good version so
$request->validated()will be empty....Section copied below for context
bad
good