2
2
3
3
namespace LaraZeus \Bolt ;
4
4
5
- use Closure ;
6
-
7
5
trait Configuration
8
6
{
9
- /**
10
- * you can overwrite any model and use your own
11
- */
12
- protected array $ boltModels = [];
13
-
14
7
protected array $ customSchema = [
15
8
'form ' => null ,
16
9
'section ' => null ,
17
10
'field ' => null ,
18
11
];
19
12
20
- protected array $ hideResources = [];
21
-
22
13
/**
23
14
* available extensions, leave it null to disable the extensions tab from the forms
24
15
*/
25
16
protected ?array $ extensions = null ;
26
17
27
- /**
28
- * the resources navigation group
29
- */
30
- protected Closure | string $ navigationGroupLabel = 'Bolt ' ;
31
-
32
18
protected bool $ formActionsAreSticky = false ;
33
19
34
20
public function customSchema (array $ schema ): static
@@ -48,38 +34,6 @@ public static function getSchema(string $type): ?string
48
34
return (new static )::get ()->getCustomSchema ()[$ type ];
49
35
}
50
36
51
- public function boltModels (array $ models ): static
52
- {
53
- $ this ->boltModels = $ models ;
54
-
55
- return $ this ;
56
- }
57
-
58
- public function getBoltModels (): array
59
- {
60
- return $ this ->boltModels ;
61
- }
62
-
63
- public static function getModel (string $ model ): ?string
64
- {
65
- return array_merge (
66
- config ('zeus-bolt.models ' ),
67
- (new static )::get ()->getBoltModels ()
68
- )[$ model ] ?? null ;
69
- }
70
-
71
- public function navigationGroupLabel (Closure | string $ label ): static
72
- {
73
- $ this ->navigationGroupLabel = $ label ;
74
-
75
- return $ this ;
76
- }
77
-
78
- public function getNavigationGroupLabel (): Closure | string
79
- {
80
- return $ this ->evaluate ($ this ->navigationGroupLabel );
81
- }
82
-
83
37
public function formActionsAreSticky (bool $ condition = false ): static
84
38
{
85
39
$ this ->formActionsAreSticky = $ condition ;
@@ -103,16 +57,4 @@ public function getExtensions(): ?array
103
57
{
104
58
return $ this ->extensions ;
105
59
}
106
-
107
- public function hideResources (array $ resources ): static
108
- {
109
- $ this ->hideResources = $ resources ;
110
-
111
- return $ this ;
112
- }
113
-
114
- public function getHiddenResources (): ?array
115
- {
116
- return $ this ->hideResources ;
117
- }
118
60
}
0 commit comments