Linking edit button from table to Laravel Edit form
<p>I have a table that displays the data from my database.  at the end of each row I have an Edit/Update Button.  I would like it when clicking on the edit button it reference the the Edit Form.</p>

<p>My edit form works.  I can access the data when visiting computers/{id}/edit, The form displays the current data and I can edit the data and submit the updates and it updates in the database (mysql).</p>

<p>This is my index.blade.php, which displays the table with the update button</p>

<pre><code>@extends('layout')


@section('content')
    &lt;h1&gt;Inventory&lt;/h1&gt;

        &lt;table class="table table-striped"&gt;
            &lt;thead&gt;
                &lt;tr&gt;
                    &lt;th&gt;Last Name&lt;/th&gt;
                    &lt;th&gt;First Name&lt;/th&gt;
                    &lt;th&gt;Department&lt;/th&gt;
                    &lt;th&gt;Building&lt;/th&gt;
                    &lt;th&gt;Room&lt;/th&gt;
                    &lt;th&gt;Manufacturer&lt;/th&gt;
                    &lt;th&gt;Device&lt;/th&gt;
                    &lt;th&gt;Model&lt;/th&gt;
                    &lt;th&gt;Service Tag&lt;/th&gt;
                    &lt;th&gt;Mac Address&lt;/th&gt;
                    &lt;th&gt;Status&lt;/th&gt;
                    &lt;th&gt;Comments&lt;/th&gt;


                &lt;/tr&gt;
            &lt;/thead&gt;

            &lt;tbody&gt;

                @foreach($inventories as $inventory)
                    &lt;tr&gt;
                    &lt;td&gt;{{$inventory-&gt;lastName}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;firstName}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;department}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;building}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;room}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;manufacturer}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;device}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;model}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;tag}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;macAddress}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;status}}&lt;/td&gt;
                    &lt;td&gt;{{$inventory-&gt;comments}}&lt;/td&gt;
                    &lt;td&gt;
                        {{--Need the button to open up my edit form--}}
                        &lt;button formaction="computers/{id}/edit"&gt;{{ trans('computers.edit') }}&lt;/button&gt;
                        {{--&lt;input type="submit" name="update" id="update" value="Update" class="btn btn-primary"&gt;--}}
                    &lt;/td&gt;
            &lt;/tr&gt;
                @endforeach
            &lt;/tbody&gt;
        &lt;/table&gt;


@stop
</code></pre>

<p>This is my form.blade.php - which is a partial that I include in my create.blade.php and edit.blade.php and both of these pages work.</p>

<pre><code>&lt;div class="row"&gt;
    &lt;div class="col-md-6"&gt;



        &lt;div class="form-group"&gt;
            {!! Form::label('lastName', 'Last Name:') !!}
            {!! Form::text('lastName', null, ['class' =&gt; 'form-control' ]) !!}
&lt;/div&gt;

&lt;div class="form-group"&gt;
    {!! Form::label('firstName', 'First Name:') !!}
    {!! Form::text('firstName', null, ['class' =&gt; 'form-control'])  !!}

&lt;/div&gt;

&lt;div class="form-group"&gt;
    {!! Form::label('departmen', 'Department:') !!}
    {!! Form::text('department', null, ['class' =&gt; 'form-control'])  !!}

&lt;/div&gt;

&lt;div class="form-group" &gt;
    {!! Form::label('building', 'Building:') !!}
    {!!  Form::select('building', ['vanHall' =&gt; 'Vanderbilt Hal',
                'wilf' =&gt; 'Wilf Hall',
                'dag' =&gt; 'D Agostino Hall',
                'furmanHall' =&gt; 'Furman Hall',
                'wsn' =&gt; 'WSN',
                'mercer' =&gt; 'Mercer',
                'training' =&gt; 'Traing Room',
                'storage' =&gt; 'Storage'

&lt;/div&gt;

&lt;div class="form-group"&gt;
    {!! Form::label('room', 'Room:') !!}
    {!! Form::text('room', null, ['class' =&gt; 'form-control'])  !!}


&lt;/div&gt;

&lt;div class="form-group"&gt;
    {!! Form::label('manufacturer', 'Manufacturer:') !!}
    {!! Form::text('manufacturer', null, ['class' =&gt; 'form-control'])  !!}

&lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="col-md-6"&gt;
&lt;div class="form-group"&gt;
    {!! Form::label('device', 'Device:') !!}
                {!!  Form::select('device', ['desktop' =&gt; 'Desktop',
                'laptop' =&gt; 'Laptop',
                'classroom' =&gt; 'Classroom',
                'printer' =&gt; 'Printer',
                'mifi' =&gt; 'MiFi',
                'panopto' =&gt; 'Panopto',
                'Other' =&gt; 'Other',
                 ], null, ['placeholder' =&gt; 'Select Device'])!!}

&lt;/div&gt;

        &lt;div class="form-group"&gt;
            {!! Form::label('model', 'Model:') !!}
            {!! Form::text('model', null, ['class' =&gt; 'form-control'])  !!}

      &lt;/div&gt;

      &lt;div class="form-group"&gt;
          {!! Form::label('tag', 'Service Tag:') !!}
          {!! Form::text('tag', null, ['class' =&gt; 'form-control'])  !!}

      &lt;/div&gt;

      &lt;div class="form-group"&gt;
          {!! Form::label('macAddress', 'Mac Address:') !!}
          {!! Form::text('macAddress', null, ['class' =&gt; 'form-control'])  !!}

      &lt;/div&gt;

        &lt;div class="form-group"&gt;
            {!! Form::label('status', 'Status:') !!}
            {!!  Form::select('status', ['active' =&gt; 'Active',
            'inactive' =&gt; 'Inactive',
             ], null, ['placeholder' =&gt; 'Status'])!!}


      &lt;/div&gt;



      &lt;div class="form-group"&gt;
          {!! Form::label('comments', 'Comments:') !!}
          {!! Form::text('comments', null, ['class' =&gt; 'form-control'])  !!}
      &lt;/div&gt;
    &lt;/div&gt;

   &lt;div class="col-md-12"&gt;
    &lt;hr&gt;
&lt;div class="form-group"&gt;

    {!! Form::submit($submitButtonText, ['class' =&gt; 'btn btn-primary form-control']) !!}
    {{--&lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;--}}

&lt;/div&gt;

&lt;/div&gt;
</code></pre>