Giter Club home page Giter Club logo

Comments (7)

barryvdh avatar barryvdh commented on May 12, 2024

Try array('data' => $data) instead of $data

from laravel-dompdf.

lstables avatar lstables commented on May 12, 2024

Tried what you said:

public function pdf()
{
$data = DailyReports::all();
$pdf = PDF::loadView('reports.daily', array('data' => $data));
return $pdf->download('report.pdf');
}

Still same error

from laravel-dompdf.

barryvdh avatar barryvdh commented on May 12, 2024

And can you show the view? Have you tried a simple view, for testing?
Probably some error in your view.
Op 4 dec. 2013 21:55 schreef "Lee Stables" [email protected]:

Tried what you said:

public function pdf()
{
$data = DailyReports::all();
$pdf = PDF::loadView('reports.daily', array('data' => $data));
return $pdf->download('report.pdf');
}

Still same error


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-29844498
.

from laravel-dompdf.

lstables avatar lstables commented on May 12, 2024

Or yeah, shit! the view i used chart.js need to do a new view then I'm guessing Sorry dude for bothering you

from laravel-dompdf.

lstables avatar lstables commented on May 12, 2024

So by creating a new view I just put in {{{ $data }}} which worked but then the pdf shows an array of data can i just do a foreach loop and put some styling to it?

from laravel-dompdf.

barryvdh avatar barryvdh commented on May 12, 2024

It should just work the same as a normal view. So you can use blade etc to
do a foreach as usual yes.
Op 4 dec. 2013 22:00 schreef "Lee Stables" [email protected]:

So by creating a new view I just put in {{{ $data }}} which worked but
then the pdf shows an array of data can i just do a foreach loop and put
some styling to it?


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-29845020
.

from laravel-dompdf.

lstables avatar lstables commented on May 12, 2024

Sweet, your a legend, and thanks for the super, super quick replies!!

from laravel-dompdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.