What is the best way to show old input when editing a form in Laravel?

How can I display old input values in a Laravel edit form while still showing the original values on the initial form load? Is it considered good practice to use a ternary operator in the value attribute to check if there’s old input and fall back to the original value if not?

value="{{ old('value') ?? $db_value }}"

Or is there a better way to achieve this?

The old() function in Laravel has a default parameter used if no old data is found in the session. You can use the original value as a second parameter to the old() function to display it on the initial form load.

value="{{ old('value', $db_value) }}"

You can also use the ternary operator, as there is not much difference between the two approaches.