i have index page with a button to remove a column from a table.
@foreach ($suppliers as $supplier)
<tr>
<th>{{ $supplier -> idSupplier }}</th>
<th style="color:blue;"><a href="/suppliers/{{$supplier->idSupplier}}">{{ $supplier -> column1 }}</a></th>
<th>{{ $supplier -> column2 }}</th>
<th>{{ $supplier -> column3 }}</th>
<th>{!! $supplier -> column4 !!}</th>
<th>
<a class="btn btn-warning" href="/suppliers/{{$supplier->idSupplier}}/edit" role="button">
<i class="fa fa-tools"></i>
Edit</a>
<a class="btn btn-danger" href="{{ action('SuppliersController@destroy') }}" role="button">
<i class="fa fa-eraser"></i>
Delete</a>
</th>
</tr>
@endforeach
but now everytime i open my index page it gives me this error message
Facade\Ignition\Exceptions\ViewException Missing required parameters for [Route: suppliers.destroy] [URI: suppliers/{supplier}]. (View: C:\xampp\htdocs\Invent\resources\views\suppliers\index.blade.php)
this is my route
Route::resource('suppliers', 'SuppliersController');
and this is destroy
function from SuppliersController
public function destroy($idSupplier)
{
$supplier = Supplier::find($idSupplier);
$supplier->delete();
return redirect('/suppliers')->with('success', 'Supplier removed');
}
I already try this solution and it gives me another error message.