From 1d5f0ed19dd0fb4a66a986b726dbe25ef55346ac Mon Sep 17 00:00:00 2001 From: Rias Date: Thu, 11 Jul 2024 12:06:01 +0200 Subject: [PATCH] Fix compatibility with older versions --- tests/TestClasses/TestMailable.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tests/TestClasses/TestMailable.php b/tests/TestClasses/TestMailable.php index 7644088..8281324 100644 --- a/tests/TestClasses/TestMailable.php +++ b/tests/TestClasses/TestMailable.php @@ -3,25 +3,13 @@ namespace Spatie\LaravelRay\Tests\TestClasses; use Illuminate\Mail\Mailable; -use Illuminate\Mail\Mailables\Attachment; class TestMailable extends Mailable { public function build() { - return $this->markdown('mails.test'); - } - - /** - * Get the attachments for the message. - * - * @return array - */ - public function attachments(): array - { - return [ - Attachment::fromData(fn () => 'file1')->as('file_1.txt')->withMime('text/plain'), - Attachment::fromData(fn () => 'file2')->as('file_2.txt')->withMime('text/plain'), - ]; + return $this->markdown('mails.test') + ->attachData('file1', 'file_1.txt') + ->attachData('file2', 'file_2.txt'); } }