@@ -332,24 +332,25 @@ function square_brackets_to_dots($string)
332332}
333333
334334if (! function_exists ('old_empty_or_null ' )) {
335- /**
336- * This method is an alternative to Laravel's old() helper, which mistakenly
337- * returns NULL it two cases:
338- * - if there is an old value, and it was empty or null
339- * - if there is no old value
340- * (this is because of the ConvertsEmptyStringsToNull middleware).
341- *
342- * In contrast, this method will return:
343- * - the old value, if there actually is an old value for that key;
344- * - the second parameter, if there is no old value for that key, but it was empty string or null;
345- * - null, if there is no old value at all for that key;
346- *
347- * This version is form-aware to prevent old values from bleeding across multiple forms.
348- *
349- * @param string $key
350- * @param array|string $empty_value
351- * @return mixed
352- */ function old_empty_or_null ($ key , $ empty_value = '' )
335+ /**
336+ * This method is an alternative to Laravel's old() helper, which mistakenly
337+ * returns NULL it two cases:
338+ * - if there is an old value, and it was empty or null
339+ * - if there is no old value
340+ * (this is because of the ConvertsEmptyStringsToNull middleware).
341+ *
342+ * In contrast, this method will return:
343+ * - the old value, if there actually is an old value for that key;
344+ * - the second parameter, if there is no old value for that key, but it was empty string or null;
345+ * - null, if there is no old value at all for that key;
346+ *
347+ * This version is form-aware to prevent old values from bleeding across multiple forms.
348+ *
349+ * @param string $key
350+ * @param array|string $empty_value
351+ * @return mixed
352+ */
353+ function old_empty_or_null ($ key , $ empty_value = '' )
353354 {
354355 $ key = square_brackets_to_dots ($ key );
355356 $ old_inputs = session ()->getOldInput ();
0 commit comments