what if I want to send data to the getDataDashboard function using ajax type post, so that the data can be returned realtime without using button clicks. in function getDataDashboard I want to put data that has been passed using ajax in variable $filter
this is sample code in function getDataDashboard :
public function getDataDashboard(Request $request){
$filter = 3;
$priode = Lowongan::select('id_lowongan',\DB::raw("DATE_FORMAT(start_priode, '%d %M %Y') as tgl"))->latest()->take($filter)->pluck('tgl');
$low = Lowongan::latest()->take($filter)->get();
return view('r-admin.dashboard.IndexDashboard', compact('priode','low');
}
code in blade page :
<form action="">
<select name="selectPriode" id="selectPriode" class="form-control">
<option value="3">3 Priode Terakhir</option>
<option value="6">6 Priode Terakhir</option>
<option value="10">10 Priode Terakhir</option>
</select>
</form>
please help me to write the ajax code so that the function can run