Finally after consuming much time on it i have got solution to that problem firstly i have set a session veritable with document id in my controller and redirect back to upload.blade.php page and in the blade page section of script i got the document id with session variable and pass this id to my document download route and register a route for downloading document in web.php and in jquery_download function return the response download(). Following is the code
############# insert Document Function
if(isset($request->document_id))
{
$document = Document::find($request->document_id)->pluck('docpath')->first();
echo $document;
echo $document_id = $request->document_id;
echo $pathToFile = public_path()."\\".$document;
// Session::flash("success", "Your File Downloaded Successfully!");
Session::flash("successTo", "$document_id");
return redirect()->back();
// return Response::download($pathToFile);
}
##################### Upload Blade
<script>
@if(Session::has('successTo'))
$(document).ready(function () {
id = {{ Session::get('successTo') }};
window.location.href = "/download/documenta/"+id;
});
@endif
</script>
##################### WEB.php
Route::get('/download/documenta/{id}', 'DocumentController@jquery_download')->name('jquery_download');
################ DOWNLOAD DOCUMENT FUNCTION IN CONTROLLER
public function jquery_download($id)
{
$document = Document::find($id)->pluck('docpath')->first();
echo $pathToFile = public_path()."\\".$document;
return Response::download($pathToFile);
}