I have the following problem: I want to insert into my database, with input fields. Here is my html:
<div class="row">
<form action="" method="post">
<input type="hidden" name="_token" value="">
<div class="col-md-2 col-sm-2">
<label for="MtrNr">MtrNr:</label>
<input type="text" name="MtrNr" class="form-control">
</div>
<div class="col-md-2 col-sm-3">
<label for="Vorname">Vorname:</label>
<input type="text" name="Vorname" class="form-control">
</div>
<div class="col-md-2 col-sm-3">
<label for="Nachname">Nachname:</label>
<input type="text" name="Nachname" class="form-control" >
</div>
<div class="col-md-2 col-sm-2">
<label for="Klassenname">Klassenname:</label>
<input type="text" name="Klassenname" class="form-control">
</div>
<div class="col-md-2 col-sm-2">
<button class="btn btn-primary option-button button_rowAllign" type="submit">Schüler hinzufügen</button>
</div>
</form>
</div>
My controller:
public function store(Request $request)
{
$user = new schueler;
$user->MatNr = Input::get("MtrNr");
$user->vorname = Input::get("Vorname");
$user->nachname = Input::get("Nachname");
$user->klassenname = Input::get("Klassenname");
}
And here my routes:
Route::post("", "test@store");
The thing is, that I already inserted into my database. But when i tried to reproduce it, it doesn't work. For local server I use xampp. I hope you can help me.
via Rechenmeister