File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,11 +45,15 @@ public function via(object $notifiable): array
4545 */
4646 public function toMail (object $ notifiable ): MailMessage
4747 {
48+ $ file = Storage::disk ('filament-excel ' )->exists ($ this ->filename )
49+ ? Storage::disk ('filament-excel ' )->get ($ this ->filename )
50+ : null ;
51+
4852 return (new MailMessage )
4953 ->subject (__ ('notification.export_finished.title ' ))
5054 ->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 ( ));
5357 }
5458
5559 /**
@@ -73,11 +77,11 @@ public function toDatabase(): array
7377 ->seconds (5 )
7478 ->icon ('heroicon-o-inbox-in ' )
7579 ->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 (),
8185 ])
8286 ->getDatabaseMessage ();
8387 }
Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ public function register(): void
2828 config ([
2929 'filament.default_filesystem_disk ' => config ('filesystems.default_public ' ),
3030 ]);
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+ ]);
3146 }
3247
3348 /**
Original file line number Diff line number Diff line change 8383 Route::post ('/{project:slug}/volunteer ' , 'volunteer ' )->name ('volunteer ' )->middleware ('throttle:register-volunteer ' );
8484});
8585
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+
8696Route::get ('/{page:slug} ' , PageController::class)->name ('page ' );
You can’t perform that action at this time.
0 commit comments