File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.1/phpunit.xsd" bootstrap =" vendor/autoload.php" colors =" true" >
3- <coverage >
4- <report >
5- <clover outputFile =" build/logs/clover.xml" />
6- </report >
7- </coverage >
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap =" vendor/autoload.php"
5+ colors =" true"
6+ >
87 <testsuites >
98 <testsuite name =" Root" >
109 <directory suffix =" Test.php" >./tests</directory >
1413 <server name =" APP_KEY" value =" base64:ybq4vTLI2AtF1xqSRZ8A52CtU9dUXu1yAcClXsNKGq4=" />
1514 <server name =" APP_ENV" value =" testing" />
1615 <server name =" BCRYPT_ROUNDS" value =" 4" />
17- <server name =" CACHE_DRIVER " value =" array" />
16+ <server name =" CACHE_STORE " value =" array" />
1817 <server name =" DB_CONNECTION" value =" sqlite" />
1918 <server name =" DB_DATABASE" value =" :memory:" />
2019 <server name =" MAIL_MAILER" value =" array" />
Original file line number Diff line number Diff line change 1313use Cone \Root \Support \Facades \Conversion ;
1414use Cone \Root \Traits \Filterable ;
1515use Cone \Root \Traits \InteractsWithProxy ;
16+ use Illuminate \Contracts \Mail \Attachable ;
1617use Illuminate \Database \Eloquent \Attributes \Scope ;
1718use Illuminate \Database \Eloquent \Builder ;
1819use Illuminate \Database \Eloquent \Casts \AsArrayObject ;
2223use Illuminate \Database \Eloquent \Model ;
2324use Illuminate \Database \Eloquent \Relations \BelongsTo ;
2425use Illuminate \Http \UploadedFile ;
26+ use Illuminate \Mail \Attachment ;
2527use Illuminate \Support \Facades \App ;
2628use Illuminate \Support \Facades \Config ;
2729use Illuminate \Support \Facades \Response ;
3133use Illuminate \Support \Str ;
3234use Symfony \Component \HttpFoundation \BinaryFileResponse ;
3335
34- class Medium extends Model implements Contract
36+ class Medium extends Model implements Attachable, Contract
3537{
3638 use Filterable;
3739 use HasFactory;
@@ -340,4 +342,14 @@ protected function type(Builder $query, string $value): Builder
340342 default => $ query ,
341343 };
342344 }
345+
346+ /**
347+ * Get an attachment instance for this entity.
348+ */
349+ public function toMailAttachment (): Attachment
350+ {
351+ return Attachment::fromPath ($ this ->getAbsolutePath ())
352+ ->as ($ this ->file_name )
353+ ->mime ($ this ->mime_type );
354+ }
343355}
You can’t perform that action at this time.
0 commit comments