33namespace {{ namespace }};
44
55use App\Models\{{ model }};
6- use App\Filament\Widgets;
6+ use Filament\Notifications\Notification;
7+ use SolutionForest\FilamentTree\Actions\Action;
8+ use SolutionForest\FilamentTree\Actions\ActionGroup;
9+ use SolutionForest\FilamentTree\Actions\DeleteAction;
10+ use SolutionForest\FilamentTree\Actions\EditAction;
11+ use SolutionForest\FilamentTree\Actions\ViewAction;
712use SolutionForest\FilamentTree\Widgets\Tree as BaseWidget;
813
914class {{ class }} extends BaseWidget
@@ -15,4 +20,49 @@ class {{ class }} extends BaseWidget
1520 protected ?string $treeTitle = '{{ class }}';
1621
1722 protected bool $enableTreeTitle = true;
23+
24+ protected function getFormSchema(): array
25+ {
26+ return [
27+ //
28+ ];
29+ }
30+
31+ // CUSTOMIZE ICON OF EACH RECORD, CAN DELETE
32+ // public function getTreeRecordIcon(?\Illuminate\Database\Eloquent\Model $record = null): ?string
33+ // {
34+ // return null;
35+ // }
36+
37+ // CUSTOMIZE ACTION OF EACH RECORD, CAN DELETE
38+ // protected function getTreeActions(): array
39+ // {
40+ // return [
41+ // Action::make('helloWorld')
42+ // ->action(function () {
43+ // Notification::make()->success()->title('Hello World')->send();
44+ // }),
45+ // // ViewAction::make(),
46+ // // EditAction::make(),
47+ // ActionGroup::make([
48+ //
49+ // ViewAction::make(),
50+ // EditAction::make(),
51+ // ]),
52+ // DeleteAction::make(),
53+ // ];
54+ // }
55+ // OR OVERRIDE FOLLOWING METHODS
56+ //protected function hasDeleteAction(): bool
57+ //{
58+ // return true;
59+ //}
60+ //protected function hasEditAction(): bool
61+ //{
62+ // return true;
63+ //}
64+ //protected function hasViewAction(): bool
65+ //{
66+ // return true;
67+ //}
1868}
0 commit comments