File tree Expand file tree Collapse file tree 3 files changed +36
-7
lines changed Expand file tree Collapse file tree 3 files changed +36
-7
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
/**
@@ -73,11 +77,11 @@ public function toDatabase(): array
73
77
->seconds (5 )
74
78
->icon ('heroicon-o-inbox-in ' )
75
79
->actions ([
76
- // Action::make('export_excel')
77
- // ->label(__('filament-excel::notifications.download_ready.download'))
78
- // ->url($this->generateURL(), shouldOpenInNewTab: true)
79
- // ->button()
80
- // ->close(),
80
+ Action::make ('export_excel ' )
81
+ ->label (__ ('filament-excel::notifications.download_ready.download ' ))
82
+ ->url ($ this ->generateURL (), shouldOpenInNewTab: true )
83
+ ->button ()
84
+ ->close (),
81
85
])
82
86
->getDatabaseMessage ();
83
87
}
Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ public function register(): void
28
28
config ([
29
29
'filament.default_filesystem_disk ' => config ('filesystems.default_public ' ),
30
30
]);
31
+ config ()
32
+ ->set ('filesystems.disks.filament-excel ' , [
33
+ 'driver ' => config ('filesystems.disks.s3private.driver ' ),
34
+ 'key ' => config ('filesystems.disks.s3private.key ' ),
35
+ 'secret ' => config ('filesystems.disks.s3private.secret ' ),
36
+ 'token ' => config ('filesystems.disks.s3private.token ' ),
37
+ 'region ' => config ('filesystems.disks.s3private.region ' ),
38
+ 'bucket ' => config ('filesystems.disks.s3private.bucket ' ),
39
+ 'url ' => config ('filesystems.disks.s3private.url ' ),
40
+ 'endpoint ' => config ('filesystems.disks.s3private.endpoint ' ),
41
+ 'use_path_style_endpoint ' => config ('filesystems.disks.s3private.use_path_style_endpoint ' ),
42
+ 'visibility ' => config ('filesystems.disks.s3private.visibility ' ),
43
+ 'throw ' => config ('filesystems.disks.s3private.throw ' ),
44
+ 'root ' => config ('filesystems.disks.s3private.root ' ) . 'filament-excel/ ' ,
45
+ ]);
31
46
}
32
47
33
48
/**
Original file line number Diff line number Diff line change 83
83
Route::post ('/{project:slug}/volunteer ' , 'volunteer ' )->name ('volunteer ' )->middleware ('throttle:register-volunteer ' );
84
84
});
85
85
86
+ Route::get ('filament-excel/{path} ' , function (string $ path ) {
87
+ if (! Storage::disk ('filament-excel ' )->exists ($ path )) {
88
+ abort (404 );
89
+ }
90
+
91
+ return Storage::disk ('filament-excel ' )->download ($ path );
92
+ })
93
+ ->where ('path ' , '.* ' )
94
+ ->name ('filament-excel-download ' );
95
+
86
96
Route::get ('/{page:slug} ' , PageController::class)->name ('page ' );
You can’t perform that action at this time.
0 commit comments