@@ -33,8 +33,14 @@ class GridstackDashboardPlugin implements Plugin
33
33
34
34
protected bool |Closure $ disableResize = false ;
35
35
36
+ protected bool |Closure $ canAccess = true ;
37
+
38
+ protected bool |Closure $ shouldRegisterNavigation = true ;
39
+
36
40
protected string |Closure $ resizable = 'se ' ;
37
41
42
+ protected string |Closure |null $ navigationLabel = null ;
43
+
38
44
public static function make (): static
39
45
{
40
46
return app (static ::class);
@@ -117,6 +123,27 @@ public function resizable(string|Closure $resizable): static
117
123
return $ this ;
118
124
}
119
125
126
+ public function canAccess (bool |Closure $ canAccess = true ): static
127
+ {
128
+ $ this ->canAccess = $ canAccess ;
129
+
130
+ return $ this ;
131
+ }
132
+
133
+ public function shouldRegisterNavigation (bool |Closure $ shouldRegisterNavigation = true ): static
134
+ {
135
+ $ this ->shouldRegisterNavigation = $ shouldRegisterNavigation ;
136
+
137
+ return $ this ;
138
+ }
139
+
140
+ public function navigationLabel (string |Closure $ navigationLabel ): static
141
+ {
142
+ $ this ->navigationLabel = $ navigationLabel ;
143
+
144
+ return $ this ;
145
+ }
146
+
120
147
public function navigationSort (int |Closure $ navigationSort ): static
121
148
{
122
149
$ this ->navigationSort = $ navigationSort ;
@@ -148,6 +175,11 @@ public function getDefaultGrid(): array
148
175
return $ this ->evaluate ($ this ->defaultGrid );
149
176
}
150
177
178
+ public function getNavigationLabel (): ?string
179
+ {
180
+ return $ this ->evaluate ($ this ->navigationLabel );
181
+ }
182
+
151
183
public function getNavigationSort (): int
152
184
{
153
185
return $ this ->evaluate ($ this ->navigationSort );
@@ -188,6 +220,16 @@ public function getDisableDrag(): ?bool
188
220
return $ this ->evaluate ($ this ->disableDrag );
189
221
}
190
222
223
+ public function getCanAccess (): ?bool
224
+ {
225
+ return $ this ->evaluate ($ this ->canAccess );
226
+ }
227
+
228
+ public function getShouldRegisterNavigation (): ?bool
229
+ {
230
+ return $ this ->evaluate ($ this ->shouldRegisterNavigation );
231
+ }
232
+
191
233
public function getDisableResize (): ?bool
192
234
{
193
235
return $ this ->evaluate ($ this ->disableResize );
0 commit comments