diff --git a/src/Controllers/Admin/LocationsController.php b/src/Controllers/Admin/LocationsController.php index b36876349..5983ffcfe 100644 --- a/src/Controllers/Admin/LocationsController.php +++ b/src/Controllers/Admin/LocationsController.php @@ -92,7 +92,7 @@ public function save(Request $request): Response $location->name = $data['name']; $location->description = $data['description']; - $location->dect = ltrim($data['dect'], '@'); + $location->dect = array_key_exists('dect', $data) && !empty($data['dect']) ? ltrim($data['dect'], '@') : null; $location->map_url = $data['map_url']; $location->save();