Hi, my name is David Carr and I'm a PHP Developer.

Blog Archives Categories Authors About Me Open Source Books Contact Me

Sponsor Me

Help support the blog so that I can continue creating new content!

My Latest Book

Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Laravel send multiple attachments to Mailables

Laravel Framework | PHP & MySQL | Tutorials

David Carr

Laravel send multiple attachments to Mailables

Rather than returning the direct mail call in the build method of a mailable you can assign it to a variable then add multiple attach calls before returning.

Here’s an example:

public function build()
    //setup the mail
    $mail = $this->subject('The subject', ['content' => $content])->markdown('mail.sendreply');

    //loop through attachments and attach to $mail
    $att = Attachment::where('sendEmail', 'Yes')->get();
    foreach($att as $file) {
        //attach the file

    //return and execute sending the mailable
    return $mail;


Copyright © 2009 - 2022 David Carr. All code MIT license. All rights reserved.