File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,12 @@ public static function form(Form $form): Form
5858 ->options (config ('filament-lms.awards ' ))
5959 ->required ()
6060 ->hint (function ($ record ) {
61- $ link = route ('filament-lms::certificates.show ' , ['course ' => $ record ->id , 'user ' => auth ()->id ()]);
61+ if ($ record ?->id) {
62+ $ link = route ('filament-lms::certificates.show ' , ['course ' => $ record ->id , 'user ' => auth ()->id ()]);
63+ return new HtmlString ("<a rel='noopener noreferrer' target='_blank' href=' {$ link }'>Click to Preview</a> " );
64+ }
6265
63- return new HtmlString ( " <a rel='noopener noreferrer' target='_blank' href=' { $ link } '>Click to Preview</a> " ) ;
66+ return null ;
6467 })
6568 ->helperText ('Form must be saved before previewing. ' ),
6669 Forms \Components \Checkbox::make ('hidden ' ),
You can’t perform that action at this time.
0 commit comments