diff --git a/app/Http/Controllers/Admin/FlightController.php b/app/Http/Controllers/Admin/FlightController.php index 48f7e405..93623c1f 100644 --- a/app/Http/Controllers/Admin/FlightController.php +++ b/app/Http/Controllers/Admin/FlightController.php @@ -185,7 +185,10 @@ class FlightController extends Controller return redirect()->back()->withInput($request->all()); } - $input['days'] = Days::getDaysMask($input['days']); + if (array_key_exists('days', $input) && filled($input['days'])) { + $input['days'] = Days::getDaysMask($input['days']); + } + $input['active'] = get_truth_state($input['active']); $time = new Time($input['minutes'], $input['hours']); @@ -287,7 +290,9 @@ class FlightController extends Controller return redirect()->back()->withInput($request->all()); } - $input['days'] = Days::getDaysMask($input['days']); + if (array_key_exists('days', $input) && filled($input['days'])) { + $input['days'] = Days::getDaysMask($input['days']); + } $input['flight_time'] = Time::init( $input['minutes'],