refactor: use Validation::getValidated() when using $this->validate() in controllers

This commit is contained in:
Yassine Doghri 2023-08-29 15:42:52 +00:00
commit 2c07070b2c
18 changed files with 129 additions and 70 deletions

View file

@ -114,10 +114,12 @@ class SoundbiteController extends BaseController
->with('errors', $this->validator->getErrors());
}
$validData = $this->validator->getValidated();
$newSoundbite = new Soundbite([
'title' => $this->request->getPost('title'),
'start_time' => (float) $this->request->getPost('start_time'),
'duration' => (float) $this->request->getPost('duration'),
'title' => $validData['title'],
'start_time' => (float) $validData['start_time'],
'duration' => (float) $validData['duration'],
'type' => 'audio',
'status' => '',
'podcast_id' => $this->podcast->id,