📅  最后修改于: 2022-03-11 14:54:51.132000             🧑  作者: Mango
// sending ajax from view to controller
// controller
class Controller_name extends Controller {
function name(Request $request) {
$post = $request->input();
header('Content-Type: Application/json');
echo json_encode($post);
}
}
// web.php
route::any('/ajax_request_url', '\App\Http\Controllers\Controller_name@name');