I'm working on Laravel project and I want to send my input values from the FORM from one page (the inscription page) to a pdf page (which I want the user to be able to download). I couldn't find a way to send them from that page to the other
input:all
using the $request
in the controller
<div class="fieldgroup">
<input type="text" style="color:0B0C51" onclick="submitform2()" name="cin" id="cin"
placeholder="N°CIN" maxlength="8" class="required"></i><br>
</div>
<div class="fieldgroup">
<input type="text" style="color:0B0C51" v-model="prenom" name="prenom" id="prenom"
placeholder="Prenom" class="required"><br>
</div>
<div class="fieldgroup">
<input type="text" style="color:0B0C51" v-model="nom" onclick="submitform2()" name="nom"
id="nom" placeholder="Nom" class="required"><br>
</div>
<div class="fieldgroup">
<input type="mail" style="color:0B0C51" name="email" id="email" placeholder="Email"
class="required" />
</div>
ViewController :
class ViewController extends Controller
{
public function generatePDF(Request $request){
$request=this.
$data="form";
$pdf= PDF::loadView('pdf',compact('data'));
return $pdf->download('Terms.pdf');
}
}
web.php:
Route::get('/pdf','ViewController@generatePDF');
inscriController:
public function store(Request $request)
{
$cin = $request->input('cin');
$data = array(['cin'=>$cin ]);
DB::table('form')->insert($data);
return redirect('/pdf')->withInput();
This returns an empty form page without the input values