0
if ($request->input('workerRGroup.sAgent')) {
$worker->isAgent = 1;
}
if ($request->input('workerRGroup.supervisor')) {
$worker->isSupervisor = 1;
}
if ($request->input('workerRGroup.human')) {
$worker->isHuman = 1;
}
if ($request->input('workerRGroup.tech')) {
$worker->isTechnical = 1;
}
那就是我已經嘗試了多選的值,laravel文檔說用點什麼,所以我用workerRGroup
這是選擇的名稱和選擇選項的值。不能得到laravel
這是我的HTML
<label><b>Rank Group</b>
<select multiple name="workerRGroup[]">
<option value="sAgent">Security Agent</option>
<option value="supervisor">Supervisor</option>
<option value="human">Human Resources</option>
<option value="tech">Technical</option>
</select>
</label>