Я получаю следующую ошибку:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'matricule_per' cannot be null (SQL: insert into `permissions` (`matricule_per`, `date_rentree`, `nbr_jour`, `nbr_jour_reste`, `updated_at`, `created_at`) values (?, ?, ?, ?, 2020-03-05 19:56:59, 2020-03-05 19:56:59))
Это моя форма:
<div class="form-group row">
<label class="col-form-label col-md-4">Matricule :</label>
<div class="col-md-8">
<select name="matricule_per" class="form-control">
@foreach ($personnes as $p)
<option value="{{$p->id}}">{{$p->mle}}</option>
@endforeach
</select>
</div>
</div>
Это PermissionController:
public function insertPer(Request $request)
{
$perm = new Permission();
$perm->matricule_per = $request->input('matricule_per');
$perm->date_rentree = $request->input('date_rentree');
$perm->nbr_jour = $request->input('nbr_jour');
$perm->nbr_jour_reste = $request->input('nbr_jour_reste');
$perm->save();
return redirect('permission');
}
public function indexP()
{
$personnes = DB::table('personnes')->select('id','mle')->get();
return view('frontend.Permission', compact('personnes'));
}