So i have this form above this works correctly with the following code:
<div class="card">
<div class="card-header"></div>
<div class="card-body">
<form method="POST" action="">
@csrf
<div class="form-group row">
<label for="serialnumber" class="col-md-4 col-form-label text-md-right"></label>
<div class="col-md-6">
<input id="serialnumber" type="text" class="form-control" name="serialnumber" value="" required autofocus>
@if ($errors->has('serialnumber'))
<span class="invalid-feedback">
<strong></strong>
</span>
@endif
</div>
</div>
<div class="form-group row">
<label for="ma_id" class="col-md-4 col-form-label text-md-right"></label>
<div class="col-md-6">
<!-- <input id="ma_id" type="text" class="form-control" value="" required> -->
<input id="ma_id" type="password" class="form-control" name="ma_id" required>
@if ($errors->has('ma_id'))
<span class="invalid-feedback">
<strong></strong>
</span>
@endif
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
My Controller to get the Data to the database:
public function store(Request $request)
{
$this->middleware('guest');
request()->validate([
'serialnumber' => 'required',
'ma_id' => 'required'
]);
Ausleih::create($request->all());
return redirect()->route('borrowed.index');
I just want to make it possible for members to offer the chance to borrow more than one book without having to go through this window again and again if they want to borrow 5 books directly. Would any of you have a solution for my problem or could you refer to something helpful that would allow me to solve the described problem? I am very grateful for any help and would like to thank you in advance for your efforts. I would also like to say that I am not an expert in Laravel so I would politely ask you to describe your answer understandable for a newbie like me.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire