In this tutorial I’m going to share how to use refresh page using controller function.
Below I have to update function who have refresh the page after on submit.
$response = response($content, 200, [
'Content-Type' => 'application/octet-stream',
'Content-Disposition' => 'attachment; filename="' . $merge1 . '"',
]);
$refreshScript = "<script>setTimeout(function() { location.reload(); }, 1000);</script>";
return response()->json([
'response' => $response->getContent(),
'refreshScript' => $refreshScript,
'merge1' => $merge1,
]);
Now after submit page refresh happening successfully.
[…] How to refresh Page using Controller Function ? […]