我有4个表,其中之一是联结表。
Employee-> emp_id,emp_name,emp_email,emp_password
部门-> dep_id,dep_name
位置-> pos_id,pos_name
部署-> id,emp_id,dep_id,pos_id,pos_type
所以我的问题是。如何从此选择表单中获取输入的数据?
create.blade.php
<form action="{{ route('deployment.store') }}" method="post">
@csrf
@include('deployments.form')
</form>
form.blade.php
<div class="form-group row">
<div class="col-md-2 col-form-label">
<label for="title">Full Name</label>
</div>
<div class="col-md-10">
<input type="text" name="name" id="name" autofocus
class="form-control @error('name') is-invalid @enderror"
value="{{ old('name') ?? $newestCliente->EmployeeName }}">
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group">
{{-- <label for="title">Department</label> --}}
<div class="form-group">
<strong>Department:</strong>
{!! Form::select('departments[]', $departments,[], array('class' => 'form-control','multiple', 'name' => 'department')) !!}
</div>
</div>
<div class="form-group">
{{-- <label for="description">Position</label> --}}
<div class="form-group">
<strong>Position:</strong>
{!! Form::select('positions[]', $positions,[], array('class' => 'form-control','multiple')) !!}
</div>
</div>
<div class="form-group">
<label for="description">Position Type</label>
<input type="text" name="position-type" class="form-control">
</div>
将控制器中的存储功能保存到数据库中的代码是什么?