Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage question #20

Closed
fridzema opened this issue May 7, 2018 · 3 comments
Closed

Usage question #20

fridzema opened this issue May 7, 2018 · 3 comments
Labels
question Further information is requested

Comments

@fridzema
Copy link

fridzema commented May 7, 2018

Hello,

When i trying to use your package, i always get null also there is no file placed in the filesystem.

      $pma_forms = PmaForm::all();
      $export = (new FastExcel($pma_forms))->export('pma_form_'.$pma_form_id.'.xlsx');
      dd($export);

Also return $export does nothing but a blank page.

Am i missing something here?

I am running Laravel Framework 5.6.20, PHP 7.2.5, on osx 10.13.4.

@rap2hpoutre
Copy link
Owner

Thank you for your contribution!

Also return $export does nothing but a blank page.

Ok, I've just fixed it (thanks to your issue) and added a unit test. In v0.2.0, export returns the full path of the created file. Please update to v0.2.0.

there is no file placed in the filesystem.

The file is placed in the current dir. If you want to store it in storage path, you could call the storage_path function:

$pma_forms = PmaForm::all();

$filename = storage_path('/pma_form_'.$pma_form_id.'.xlsx');
$export = (new FastExcel($pma_forms))->export($filename);

dd($export);  // It should now display the file name.

Does this fix your issue? Let me know if it does not work!

@fridzema
Copy link
Author

fridzema commented May 8, 2018

@rap2hpoutre Thanks for your quick answer!

I have managed to get it to work while looking in the source code and find the download function(maybe you should add in readme/docs).
I was trying to save to storage and after that generate a download myself, but no need for that anymore with the download function.

@rap2hpoutre rap2hpoutre added the question Further information is requested label May 8, 2018
@rap2hpoutre
Copy link
Owner

maybe you should add in readme/docs

Done, thank you! I just updated the readme: e25a70a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants