hello i have problem ith my filter table fitur, how to solved this problem The PUT method is not supported for this route. Supported methods: POST. ?
this is the button in my blade view
<!-- Modal Add Tanggal -->
<div class="modal fade" id="addTanggal" tabindex="-1" role="dialog" aria-labelledby="addTanggalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content ">
<div class="modal-header">
<h5 class="modal-title mb-0" id="addTanggalLabel">Pilih Periode Transaksi</h5>
</div>
<div class="modal-body">
<!-- Card body -->
<form role="form" action="{{ route('rekap.penjualan.filter') }}" method="POST">
@csrf
@method('put')
<div class="row input-daterange datepicker align-items-center">
<div class="col">
<div class="form-group">
<label class="form-control-label">Awal Tanggal</label>
<input class="form-control" id="created_at" name="awal" placeholder="Awal Tanggal" type="text" value="">
</div>
</div>
<div class="col">
<div class="form-group">
<label class="form-control-label">Akhir Tanggal</label>
<input class="form-control" name="akhir" placeholder="Akhir Tanggal" type="text" value="">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Lihat Data</button>
</div>
</form>
</div>
</div>
</div>
this is the route
//rekapan transaksi Penjualan
Route::get('rekapan/penjualan', 'AppHttpControllersTransaksiController@rekappenjualan')->name('rekap.penjualan');
Route::post('rekapan/penjualan/filter', 'AppHttpControllersTransaksiController@rekapfilter')->name('rekap.penjualan.filter');
Route::delete('rekapan/penjualan/delete/{id}', 'AppHttpControllersTransaksiController@delete')->name('rekap.penjualan.delete')->middleware('admin');
Route::get('rekapan/penjualan/detail', 'AppHttpControllersTransaksiController@detailrekappenjualan')->name('rekap.penjualan.detail');
this is the controller
public function rekapfilter(Request $request)
{
$start = $request->awal;
$end = $request->akhir;
$transaksis = Transaksi::select('kode_transaksi', 'bayar', 'kembali', 'created_at', DB::raw('sum(total_barang) as total_beli'), 'subtotal', 'user_id', 'daftar_pelanggan_id')
->groupBy('kode_transaksi', 'bayar', 'kembali', 'created_at', 'subtotal', 'user_id', 'daftar_pelanggan_id')
->whereBetween(DB::raw('DATE(created_at)'), array($start, $end))->get();
return view('pages.rekapan.penjualan', compact('transaksis'));
}
question from:
https://stackoverflow.com/questions/65879965/the-put-method-is-not-supported-for-this-route-supported-methods-post-in-lara 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…