vendredi 9 septembre 2016

Dompdf is not working in laravel 5.1's console/kernel.php

Css float is not working while running the function inside Kernel.php

But it works properly in normal controller function.

This is kernel.php

    $schedule->call(function () {

        $poolMail = EmailPool::where('status', 0)->get();
        foreach($poolMail as $p)
        {
        $this->createReservationPdf($content['rcode']);
        }

    })->everyMinute();



    public function createReservationPdf($resId)
{
    $rsvData = \App\Reservation::where('reservation_code', $resId)->first();
    $rsvPayment = \App\ReservationPayment::where('reservation_code', $resId)->first();
    $rsvExtras = \App\RsvExtra::where('r_no', $resId)->get();
    $rsvInsurances = \App\RsvInsurance::where('r_no', $resId)->get();

    $pStation = \App\Station::where('istasyon_kodu', $rsvPayment->pstation)->first();
    $rStation = \App\Station::where('istasyon_kodu', $rsvPayment->rstation)->first();
    $carGroup = \App\Group::where('grp', $rsvPayment->vgroup)->first();


    $pdf = \PDF::loadView('pdf.test', compact('rsvData', 'rsvPayment', 'rsvExtras', 'rsvInsurances', 'pStation', 'rStation', 'carGroup'));
    return $pdf->save(storage_path().'/'.$resId.'.pdf');
}

And createReservationPdf is working well in any other controller.

Actually, it was working until a couple of days ago.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire