Show how you have implemented the button in the view; it appears you are sending a GET request because either (i) you did not add the POST method attribute on a form, or (ii) you are using an a element to a POST route.
Jan 25, 2021
7
Level 4
laravel redirect with post method
i have the route which fetch the data when i send the request,
with that data in the blade view i have the button to select the ID and update
it update well but am get this error
The GET method is not supported for this route. Supported methods: POST
In my web
//fetch data
Route::post('sales_reports_by_team','ReportController@reportbyteam')->name('reports.team');
//select bill_number and update the status=1
Route::post('/audit_bill/{bill_number}','ReportController@auditbillnumber')->name('audit.bill');
My controller
public function auditbillnumber(Request $request,$bill_number)
{
DB::table('sales')->where('sales.bill_number', $bill_number)->update(['audit_status'=>1]);
return redirect()->back()->with('alert','Bill has been updated Successfully');
}
Please or to participate in this conversation.