title: Laravel : how to pass parameters to my view and display them in Form::text and Form::date?
body: <p>I'm trying to make a view for editing fields. </p>
  
  <p>In fact I have two problems :</p>
  
  <p>1) I get my data from my db with my controller, that's work, and I try to pass it to my view, that doesn't work...</p>
  
  <p>2) I want to display these data in Form::text and Form::date, that doesn't work...</p>
  
  <p>What I've in my controller :</p>
  
  <pre><code>public function edit($id)
      {
          $data = DB::connection('my-db')
              -&gt;table('my-table')
              -&gt;where('id', '=', $id)
              -&gt;select('field1', 'field2')
              -&gt;first();
  
          return view('my-view', compact('field1', 'field2'));
      }
  </code></pre>
  
  <p>I don't even know if compact in return view works like this</p>
  
  <p>What I've in my view :</p>
  
  <pre><code>&lt;div class="col-md-6"&gt;
    {!! Form::text(field1, "", ['id'=&gt; 'idField', 'class' =&gt; 'form-control', 'placeholder' =&gt; 'Modify field']) !!}
  &lt;/div&gt;
  &lt;div class="col-md-2"&gt;
    {!! Form::date(field2, "", ['id'=&gt; 'datetimepicker', 'class' =&gt; 'form-control']) !!}
  &lt;/div&gt;
  </code></pre>
  
  <p>I hope it's understandable, and thanks for your future answers :)</p>