How to update data from a form in Laravel 5.2
<p>Hi I am having problems on editing and updating data from my form. I already tried to get the data from the form but when I try to edit and update it, it will make another data. Thanks!</p>

<pre><code>Controller: 
        public function registerPackage()
    {       
        $activity_packages = Chap_activity_packages::all();
        return view('admin.registerPackage',compact('activity_packages'));
    }

    public function savePackage(Request $request)

    {
        $this-&gt;validate($request,[
        'chap_activity_packages_name'=&gt;'required|Min:4|unique:chap_activity_packa        ges',
        'chap_activity_packages_price'=&gt;'required|numeric'
        ]);

        $values = $request-&gt;all();
        Chap_activity_packages::create($values);
        return view('admin.registerPackage');
    }

    public function editPackage($id)
    { 
        $act = Chap_activity_packages::find($id);
        $activity_packages=Chap_activity_packages::all();

        return view('admin.registerPackage',compact('act','activity_packages'));

    }

         &lt;h4 class="page-header"&gt;Packages Management&lt;/h4&gt;
                &lt;div class="row"&gt;
                    &lt;div class="col-xs-5"&gt;
                        &lt;div class="panel panel-success"&gt;
                            &lt;div class="panel-heading"&gt;
                                &lt;h3 class="panel-title"&gt;Register New Package&lt;/h3&gt;

                                        @if($errors-&gt;any())
                                                &lt;div class="alert alert-danger"&gt;
                                                    @foreach($errors-&gt;all() as $error)
                                                        &lt;div&gt;{{ $error }}&lt;/div&gt;
                                                    @endforeach
                                                &lt;/div&gt;
                                        @endif

                                        @if(Session::has('flash_message'))
                                                &lt;div class="alert alert-success"&gt;
                                                      {{ Session::get('flash_message') }}
                                                &lt;/div&gt;
                                        @endif


                            &lt;/div&gt;
                                &lt;div class="panel-body"&gt;
                                {{ Form::open(array('url' =&gt; 'admin/registerPackage')) }}

                                &lt;div class="form-group"&gt;
                            {{ Form::label('chap_name','Package Name:') }}
                            {{ Form::text('chap_activity_packages_name',isset($act)? $act-&gt;chap_activity_packages_name:null,['class' =&gt; 'form-control', 'placeholder' =&gt; 'Enter package name']) }}
                                &lt;/div&gt;          

                                    &lt;div class="form-group"&gt;
                            {{ Form::label('chap_price','Package Price:') }}
                            {{ Form::text('chap_activity_packages_price',isset($act)? $act-&gt;chap_activity_packages_price:null,['class' =&gt; 'form-control', 'placeholder' =&gt; 'Enter package price']) }}
                                    &lt;/div&gt;

                                    &lt;div class="form-group"&gt;
                                        {{ Form::submit('Register Package',['class' =&gt; 'btn btn-success btn-block']) }}
                                    &lt;/div&gt;

                                {{ Form::close() }}
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;


@stop
@section('content2')
                                    &lt;div class="panel panel-success"&gt;
                                        &lt;div class="panel-heading"&gt;
                                            &lt;h4 class="panel-title"&gt;Available Packages&lt;/h4&gt;
                                        &lt;/div&gt;
                                        &lt;div class="panel-body"&gt;
                                            &lt;table class="table table-striped table-hover"&gt;
                                                &lt;thead&gt;
                                                    &lt;tr&gt;
                                                        &lt;th&gt;Package Name&lt;/th&gt;
                                                        &lt;th&gt;Package Price&lt;/th&gt;
                                                        &lt;th&gt;Action&lt;/th&gt;
                                                    &lt;/tr&gt;
                                                &lt;/thead&gt;
                                                &lt;tbody&gt;

                                                            @foreach($activity_packages as $activity_package)

                                                                    &lt;tr&gt;
                                                                        &lt;td&gt; {{ $activity_package-&gt;chap_activity_packages_name }} &lt;/td&gt;
                                                                        &lt;td&gt; {{ $activity_package-&gt;chap_activity_packages_price }} &lt;/td&gt;

                                                                        &lt;td&gt;

                                                                                &lt;a href='{{ url("admin/editPackage/$activity_package-&gt;id") }}'&gt;&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;&lt;/a&gt;

                                                                                &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/a&gt;
                                                                        &lt;/td&gt;

                                                                    &lt;/tr&gt;

                                                            @endforeach

                                                &lt;/tbody&gt;
                                            &lt;/table&gt;
                                        &lt;/div&gt;
                                    &lt;/div&gt;
      @stop
</code></pre>

<p>These are my codes for both the controller and the view. please let me know if what is wrong. thanks a lot!</p>