Skip to content

Commit 48708bd

Browse files
committed
Improve docs for undeletable toggle
1 parent 80dbc36 commit 48708bd

File tree

3 files changed

+43
-15
lines changed

3 files changed

+43
-15
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,6 @@ check:
629629
- Seppe: menu components ok?
630630

631631
release:
632-
- policies:
633-
- note: undeletable pages
634-
- undeletable page toggle only for permission holder
635632
- Kristof: screenshots + banner + packagist + slack + filament plugin store
636633

637634
## Future work

config/filament-flexible-content-block-pages.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,15 @@
123123
*/
124124
'navigation_sort' => 5,
125125

126+
/*
127+
| Authorisation gates for the page resource.
128+
*/
126129
'gates' => [
127-
'undeletable' => 'change_undeletable:page',
130+
/*
131+
| The authorisation gate to show the undeletable toggle on the edit page.
132+
| The value should be the name of the gate to execute `Gate::allows($gateName, User $user, Page $page)`
133+
*/
134+
'undeletable' => 'change_undeletable',
128135
],
129136
],
130137
// If you extend PageResource and want to use your own model, you can add your the extended page resource config for your own model here...

documentation/configuration.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,46 @@ Configure various features and options for the page resource. These settings con
101101
```php
102102
'page_resource' => [
103103
\Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class => [
104-
// Enable call-to-action buttons in the hero section
104+
/*
105+
| Enable the feature to have call-to-action buttons in the hero of the page
106+
*/
105107
'enable_hero_call_to_actions' => true,
106-
107-
// Enable author field for pages
108+
109+
/*
110+
| Enable the feature for pages to have an author
111+
*/
108112
'enable_author' => true,
109-
110-
// Enable parent page relationships (hierarchical pages)
113+
114+
/*
115+
| Enable the feature for pages to have parent pages.
116+
*/
111117
'enable_parent' => true,
112-
113-
// Enable undeletable flag to protect important pages
118+
119+
/*
120+
| Enable the feature for pages to have a boolean to make them undeletable.
121+
*/
114122
'enable_undeletable' => true,
115-
116-
// Enable the feature for pages to have a boolean to make them undeletable
123+
124+
/*
125+
| Enable the replicate action on the table
126+
*/
117127
'enable_replicate_action_on_table' => false,
118-
119-
// Navigation sorting order in Filament admin
128+
129+
/*
130+
| The Filament navigation menu sorting order of the page resource
131+
*/
120132
'navigation_sort' => 5,
133+
134+
/*
135+
| Authorisation gates for the page resource.
136+
*/
137+
'gates' => [
138+
/*
139+
| The authorisation gate to show the undeletable toggle on the edit page.
140+
| The value should be the name of the gate to execute `Gate::allows($gateName, User $user, Page $page)`
141+
*/
142+
'undeletable' => 'change_undeletable',
143+
],
121144
],
122145
// Add extended page resource configurations here...
123146
],
@@ -131,6 +154,7 @@ Configure various features and options for the page resource. These settings con
131154
- **enable_undeletable**: Adds a boolean field to protect important pages from deletion
132155
- **enable_replicate_action_on_table**: Shows the replicate action in the table
133156
- **navigation_sort**: Controls the order of the page resource in the Filament navigation menu
157+
- **gates.undeletable**: The authorisation gate to allow the deletable toggle to be shown on the page edit page.
134158

135159
## CMS Panel Configuration
136160

0 commit comments

Comments
 (0)