亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

此路由不支持 POST 方法。支持的方法:獲取,頭部,看跌期權

此路由不支持 POST 方法。支持的方法:獲取,頭部,看跌期權

PHP
元芳怎么了 2022-09-17 17:46:28
我有一個帶有復選框的薪水數據表,并且由尚蒂爾填寫了一個選擇,我想根據切克線更新在選擇中選擇的CHANTIER的薪水的多個錢蒂爾,但它給了我錯誤。嗨,我有一個帶有復選框的薪水數據表,并且由CHANTIERS填寫了一個選擇,我想根據切克線更新多個由CHANTIER選擇的薪水,但它給了我錯誤。感情.php <div class="form-group col-md-3">                  <select class="form-control" id="chantier">                          <option></option>                           @foreach($chantiers as $chantier)                          <option value="{{ $chantier->id }}">{{ $chantier->chantier}}</option>                           @endforeach                  </select>              </div>              <div class="form-group col-md-4">               <button class="btn btn-theme update-all" data-url="">Update All</button>              </div><table id="example" class="table table-striped table-bordered" style="width:100%">                 <thead>                  <tr>                    <th><input type="checkbox" id="check_all"></th>                    <th>nom prenom</th>                    <th>cin</th>                    <th>matricule</th>                    <th>chantier</th>                  </tr>                 </thead>                <tbody>                  @foreach($salaries as $salarie)                  <tr id="{{$salarie->id}}">                    <td><input type="checkbox" class="checkbox" name="customer_id[]" value="{{$salarie->id}}" /></td>                    <td>{{ $salarie->nom }} {{ $salarie->prenom }}</td>                    <td>{{ $salarie->cin }}</td>                    <td>{{ $salarie->matricule }}</td>                    <td>{{ $salarie->chantier->chantier }}</td>                  </tr>                  @endforeach                </tbody></table>
查看完整描述

2 回答

?
翻過高山走不出你

TA貢獻1875條經驗 獲得超3個贊

HTTP 不支持該方法,您可以使用 POST 并將_method=PUT 參數添加到數據正文中。即:PUT


<script type="text/javascript">

    $.ajax({

     url:"{{ route('salarie.multiple-update') }}",

     method:'POST',

     headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},

     data:{

       id:id,

       chantier:chantier,

       _method: "PUT"

    });

</script>


查看完整回答
反對 回復 2022-09-17
?
慕村225694

TA貢獻1880條經驗 獲得超4個贊

PHP 本身不支持對 PUT 方法的支持。為此,您可以使用 POST 并將_method= PUT 參數添加到查詢字符串中。即:


 <script type="text/javascript">

    $.ajax({

     url:"{{ route('salarie.multiple-update') }}" + '?_method=PUT',

     method:'POST',

     headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},

     data:{

       id:id,

       chantier:chantier

    });

</script>


查看完整回答
反對 回復 2022-09-17
  • 2 回答
  • 0 關注
  • 113 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號