This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

phplee
phplee

I have a list with each row containing a download link:

<a href="#" data-request="{{ __SELF__ }}::onCertificate" data-request-data="id: {{ order.id }}" title="Download your certificate"><i class="fa fa-certificate" style="font-size:150%" aria-hidden="true"></i></a>

I then have this:

public function onCertificate(){
    $order  = Order::where('id', $this->input['id'])->where('user_id', Auth::getUser()->id)->first();
    $pdf    = DB::table('renatio_dynamicpdf_pdf_templates')->where('id', $order->certificate_id)->first();
    $data   = $order->toArray();
    return PDF::loadTemplate($pdf->code, $data)->download('Certificate.pdf');

}

I want it to force a download but this isn't working. What am i doing wrong.

thanks

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.