Skip to content

Instantly share code, notes, and snippets.

@lukearmstrong
Created December 27, 2014 18:34
Show Gist options
  • Save lukearmstrong/6487b08dfd64aee90ee8 to your computer and use it in GitHub Desktop.
Save lukearmstrong/6487b08dfd64aee90ee8 to your computer and use it in GitHub Desktop.
Is there a better way of setting the value of a field on a form shared with create/edit views using Laravel 5?
<input type="text" name="forename" class="form-control" id="forename" value="{{ ! is_null(old('forename')) ? old('forename') : (isset($model->forename) ? $model->forename : '') }}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment