diff --git a/app/Http/Controllers/ControlController.php b/app/Http/Controllers/ControlController.php index fb828d76..91661ec4 100644 --- a/app/Http/Controllers/ControlController.php +++ b/app/Http/Controllers/ControlController.php @@ -565,7 +565,7 @@ public function plan(int $id) if ($control === null) { return; } - +xxxxx $years = []; $cur_year = Carbon::now()->year; for ($i = 0; $i <= 3; $i++) { @@ -645,9 +645,7 @@ public function doPlan(Request $request) $control = Control::find($request->id); // Control not found - if ($control === null) { - abort(404); - } + abort_if($control === null, Response::HTTP_NOT_FOUND, '404 Not Found'); // Control already made ? if ($control->realisation_date !== null) { @@ -683,11 +681,10 @@ public function make(Request $request) $id = (int) request('id'); - // Control not found $control = Control::find($id); - if ($control === null) { - abort(404); - } + + // Control not found + abort_if($control === null, Response::HTTP_NOT_FOUND, '404 Not Found'); // Control already made ? if ($control->realisation_date !== null) { @@ -732,9 +729,7 @@ public function doMake() $control = Control::find($id); // Control not found - if ($control === null) { - abort(404); - } + abort_if($control === null, Response::HTTP_NOT_FOUND, '404 Not Found'); // control already made ? if ($control->realisation_date !== null) { @@ -790,9 +785,7 @@ public function save(Request $request) $control = Control::find($request->id); // Control not found - if ($control === null) { - abort(404); - } + abort_if($control === null, Response::HTTP_NOT_FOUND, '404 Not Found'); $control->name = request('name'); $control->scope = request('scope'); diff --git a/resources/views/measures/show.blade.php b/resources/views/measures/show.blade.php index c0c3c682..c3855b49 100644 --- a/resources/views/measures/show.blade.php +++ b/resources/views/measures/show.blade.php @@ -108,7 +108,6 @@  
- @csrf