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

[11.x] Add fromUrl() to Attachment #52688

Merged
merged 3 commits into from
Sep 11, 2024
Merged

Conversation

KennedyTedesco
Copy link
Contributor

The current Attachment::fromPath() method allows adding attachments from file paths, but it isn't immediately clear that URLs can be used with this method. This ambiguity could lead to confusion for users who want to attach files hosted on external URLs.

By adding the Attachment::fromUrl() method, the intent becomes explicit, improving the developer experience.

public function attachments(): array
{
    return [
        Attachment::fromUrl('https://host.com/files/file.pdf'),
    ];
}

Wdyt?

@timacdonald timacdonald marked this pull request as draft September 9, 2024 22:22
@timacdonald timacdonald marked this pull request as ready for review September 9, 2024 22:40
@taylorotwell taylorotwell merged commit dcb8163 into laravel:11.x Sep 11, 2024
31 checks passed
@KennedyTedesco KennedyTedesco deleted the attachment branch September 11, 2024 21:15
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.

3 participants