title: How to display 'selected' value of dropdown in Laravel Blade template used for both edit/create?
body: <p>I'm using Blade templating in a Laravel 4 view to display a form for both create and edit, it all works fine until I have to render a <code>select</code> input type - it's ok when editing, but when creating a new record I get an error message <code>Undefined variable: data</code>, which is triggered by the 'selected' value in the second last line (last parameter passed to <code>Form::select()</code>)</p>
  
  <pre><code>@if( isset( $data) )
      {{ Form::model( $data ) }}
  @else
      {{ Form::open() }}
  @endif
  
      {{ Form::label( 'foo', 'label text' ) }}
      {{ Form::select( 'foo' , array('0' =&gt; 'No', '1' =&gt; 'Yes'), $data-&gt;foo ); }}
  {{ Form::close() }}
  </code></pre>
  
  <p>is there a standard way in Laravel to avoid this when <code>$data</code> is not defined, using model binding as I have so far? Or do I need to simply use a variable to check in advance if <code>$data</code> is not undefined?</p>