diff --git a/app/Http/Controllers/Fo/EggController.php b/app/Http/Controllers/Fo/EggController.php index 34e86d9..4d26d7d 100644 --- a/app/Http/Controllers/Fo/EggController.php +++ b/app/Http/Controllers/Fo/EggController.php @@ -88,7 +88,7 @@ class EggController extends Controller collect($inuavs)->map(function ($inuav) use ($mep) { $mep->where('inuav_codes', 'LIKE', "%{$inuav}%"); }); - $mep->where('transfert_date', '<', $datePonte) + $mep = $mep->where('transfert_date', '<', $datePonte) ->orderBy('transfert_date', 'DESC')->first(); if ($mep) { diff --git a/app/Jobs/CafelJobs.php b/app/Jobs/CafelJobs.php index ba269ee..03f2340 100644 --- a/app/Jobs/CafelJobs.php +++ b/app/Jobs/CafelJobs.php @@ -76,14 +76,12 @@ abstract class CafelJobs implements ShouldQueue $failed = $validator->invalid(); $this->invalidRows[] = collect($row)->put('validation_message', collect($e->errors()) ->mapWithKeys(function (array $messages, string $attribute) use ($failed) { - if (!array_key_exists($attribute, $failed)) { - throw new \RuntimeException( - "ValidationException is missing faling data for '{$attribute}'" - ); + $verifiedValue = ''; + if (array_key_exists($attribute, $failed)) { + $verifiedValue = ' Valeur vérifiée : ' . \json_encode($failed[$attribute]); } return [ - $attribute => collect($messages)->implode(', ') . - ' Valeur vérifiée : ' . \json_encode($failed[$attribute]) + $attribute => collect($messages)->implode(', ') . $verifiedValue ]; })->implode(' '))->all(); }