File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,15 @@ public function via(object $notifiable): array
45
45
*/
46
46
public function toMail (object $ notifiable ): MailMessage
47
47
{
48
+ $ file = Storage::disk ('filament-excel ' )->exists ($ this ->filename )
49
+ ? Storage::disk ('filament-excel ' )->get ($ this ->filename )
50
+ : null ;
51
+
48
52
return (new MailMessage )
49
53
->subject (__ ('notification.export_finished.title ' ))
50
54
->line (__ ('notification.export_finished.body ' , ['filename ' => $ this ->filename ]))
51
- ->attach (Storage:: disk ( ' filament-excel ' )-> path ( $ this ->filename ) )
52
- ->action (__ ('notification.export_finished.action ' ), Storage:: disk ( ' filament-excel ' )-> url ( $ this ->filename ));
55
+ ->attachData ( $ file , $ this ->filename )
56
+ ->action (__ ('notification.export_finished.action ' ), $ this ->generateURL ( ));
53
57
}
54
58
55
59
/**
Original file line number Diff line number Diff line change 84
84
});
85
85
86
86
Route::get ('filament-excel/{path} ' , function (string $ path ) {
87
- return
88
- response ()
89
- ->download (Storage::disk ('filament-excel ' )->path ($ path ), substr ($ path , 37 ))
90
- ->deleteFileAfterSend ();
87
+ if (! Storage::disk ('filament-excel ' )->exists ($ path )) {
88
+ abort (404 );
89
+ }
90
+
91
+ return Storage::disk ('filament-excel ' )->download ($ path );
91
92
})
92
93
->where ('path ' , '.* ' )
93
94
->name ('filament-excel-download ' );
You can’t perform that action at this time.
0 commit comments