I can get into code if necessary, but I'm first interested in just how this might normally be done... at a high level.
The quick overview:
I'm building a reporting engine.
There are a few available reports, user clicks on one and goes to a report options page. This is just a small form with, for instance, a date range picker.
The submit button on that options page hits the controller method to generate and return the html view of the report.
On that view, there is a back button, as well as export buttons for pdf, excel, etc.
My two questions are basically this:
1 - How do I get the back button to behave like the browser's back button. I.e., I'd like the form to pre-populate with the previous values.
2 - If I click the pdf export button for instance, how does the controller method that request hits get access to the already generated report.
What I've tried:
1 - I've tried using the session()->flash() and ->reflash() to no avail. Not really sure where I'm failing there. Also dipped a toe into using the cache functionality (db driver).
2 - In my ReportsController@generate method, I'm doing this:
$this->report = $report->getDompdf()->outputHtml();
So the controller itself has the report. How do I get at this from the subsequent method call in this controller?
One of the complicating bits is that I've done my best to create my reportOptions, reportView and generate methods report-agnostic. The same methods will be used for all my reports, so I can't just grab the specific form inputs out of the request.
Any insight would be much appreciated. Thanks!