I'm using Laravel 7 and got stuck since few days!
Controller:
public function edit(Bricks $bricks)
{
return view('bricks.edit', compact('bricks'));
}
Routes:
Route::resource('bricks','BricksController');
Index:
<a href="{{ route('bricks.edit',$item->id) }}" class="btn btn-sm btn-warning btn-circle">
EDIT
</a>
edit blade file:
<form action="{{ route('bricks.update',$bricks->id) }}" method="POST">
@csrf
@method('PUT')
<div class="box-body">
<div class="form-group">
<label for="">Vehicle Number</label>
<input name="vehicle_number" value="{{ $bricks->vehicle_number }}" type="name" class="form-control" id="" placeholder="Enter Vehicle Number">
</div>
<div class="form-group">
<label for="">Bill Number</label>
<input name="bill_number" value="{{ $bricks->bill_number }}" type="name" class="form-control" id="" placeholder="Enter Bill Number">
</div>
<div class="form-group">
<label for="">Per Unit Rate</label>
<input name="per_unit_rate" value="{{ $bricks->per_unit_rate }}" type="number" class="form-control" id="" placeholder="Enter Per Unit Rate">
</div>
<div class="form-group">
<label for="">Total Units</label>
<input name="total_units" value="{{ $bricks->total_units }}" type="number" class="form-control" id="" placeholder="Enter Total Units">
</div>
<div class="form-group">
<label for="">Total Rate</label>
<input name="total_rate" value="{{ $bricks->total_rate }}" type="number" class="form-control" id="" placeholder="Enter Total Rate">
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary">Update This Entry</button>
</div>
</form>
I just added the edit.blade.php file in which the error is occuring!
question from:
https://stackoverflow.com/questions/65952134/missing-required-parameters-for-route-bricks-update-uri-bricks-brick-v 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…