I am creating a project in Laravel. The updatepackage.blade.phpuser has checked the box. The flag string values are then stored in the database and sent to another view called printpackage.blade.php.
This is where the problem begins. When the user refreshes the page, the values indicated in the entries are automatically inserted into the database. I do not know how to stop this.
updatepackage.blade.php
<td align='center'>{{$i}}</td>
<td><input type='text' name="meter[]" readonly value="{{$item['passmts']}}" ></td>
<td><input type='text' name="points[]" readonly value="{{$item['points']}}"></td>
<td><input type='text' name="pts[]" readonly value="{{$item['pts']}}"></td>
<td><input type="checkbox" name="ids[]"value="{{$i}}" /></td>
clientcontroller.php
$insert=DB::table('packageroll')->insert(array(Input::all()));
$tc=\Input::get('tc');
$construction=\Input::get(construction');
$table1= DB::table('packageroll')->where('tc','=',$tc)->where('construction','=',$construction)->get();
return \View::make('dashboard.vendor.printpackage')->with('table1',$table1);
printpackage.blade.php
<td><input type='text' name='meter[]' value="{{$item['meter']}}" ></td>
<td><input type='text' name='points[]' value="{{$item['points']}}"></td>
<td><input type='text' name='pts[]' value="{{$item['pts']}}"></td>
source
share