Query Not Showing results after returning back to the view
I have a listall view which displays all the conversations from a table. I used a controller to pass in the query and display it on the page.
I also created a delete controller which will then take the current one selected, match the first conversation found and delete it from the backend, api, and return back to the listall view.
But the issue is when i return to the view it displays as empty. If i refresh the page it will return to normal.
Do I save the query on top of the page for it to display the conversations regardless of passing the data into the view? Or do i update my delete controller to query the data again and reference the same variable from the listall controller?
I don't what setup you have, ajax, regular blade view, etc. I haven't looked up the back helper in the api, but it should do similar to:
$areturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo "<br>";
$haystack = $areturn;
$needle = '?';
$pos = strripos($haystack, $needle);
if ($pos === false) { // page 1
$areturn = $areturn . "?sch=" . Session::get('search') . "&acct=" . Session::get('account') . "&page=1";
Session::set('areturn', $areturn);
} else {
Session::set('areturn', $areturn);
}
Which is used in an older framework I have. basically it returns where I left off after an edit, otherwise if I was on page 1, it returns there.
Usage in controller:
$vurl = Session::get('areturn');
return redirect($vurl);
And yes the complete cycle of querying the data takes place.
What is happening when you use:
return back();
If it is not working correctly try to build yourself a custom redirect.
Again above was just example of what needs to happen to get you back where you were. And ajax will be different.
Please or to participate in this conversation.