I'm trying to insert data into a database with an option menu.
<select class="form-control" name="tim">
@foreach ($tim as $t)
<option value="{{ $t->id }}">{{ $t->name }}</option>
@endforeach
</select>
and this the controller
$data=new Modelverif();
$data->id_profil=$request->id;
$data->$id_pegawai=$request->get('tim');
$data->save();
how to input database with option menu with array?
Blade.php
<select class="form-control" name="tim">
@foreach ($tim as $t)
<option value="{{ $t->id }}">{{ $t->name }}</option>
@endforeach
</select>
the controller
$data=new Modelverif();
$data->id_profil=$request->id;
$data->$id_pegawai=$request->tim; //Or $data->$id_pegawai= $request->input('tim');
$data->save();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments