i have serialize data in my code, to make me more flexible in inputing data
but i still dont know how to displaying serialize data in blade
this is my serialize data
this is my controller
public function preview($id)
{
$form = NewForm::whereId($id)->firstOrFail();
// return $form;
if($form->is_published)
{
$data['form'] = $form;
$data['participant'] = $form->participant;
$data['idea'] = $form->idea;
$data['character'] = $form->character;
$data['link'] = $form->link;
$data['images'] = $form->images;
$data['finance'] = $form->finance;
$data['competition'] = $form->competition;
$data['competition_list'] = $form->competition_list;
$data['audition'] = $form->audition;
$data['confirmation'] = $form->confirmation;
$data['survey'] = unserialize($form->survey);
// return $data;
$pdf = PDF::loadView('pdf.form', $data);
return $pdf->stream('DSCX'.sprintf("%04d", $form->id).'.pdf');
}
return 'Proposal not published';
}
this is my blade
<label>Survey</label>
<p>{{ $survey->source }}</p>
</td>
when i do
unserialize($form->survey) it is returning this error unserialize(): Error at offset 0 of 251 bytes
how do i display the data? thank you