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

Fix inconsistent behavior in save() method when using vs not using a disk #196

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aalyusuf
Copy link

Currently, the save() function behaves slightly differently when using a disk versus not using one. This PR resolves the inconsistency by creating a temporary file during saving.

Example of the issue:

Pdf::view('invoice')->save('invoice.png'); // Saves a PNG file

Pdf::view('invoice')->disk('s3')->save('invoice.png'); // Saves a PDF file

Using $fileName instead of $path directly to avoid any errors when saving to a full path.

@freekmurze
Copy link
Member

Could you add a test to prove that the changes work?

@aalyusuf
Copy link
Author

@freekmurze Added 👍

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

Successfully merging this pull request may close these issues.

2 participants