6
6
7
7
trait Configuration
8
8
{
9
- /**
10
- * you can overwrite any model and use your own
11
- */
12
- protected array $ models = [];
13
-
14
- /**
15
- * set the default upload options.
16
- */
17
9
protected Closure | string $ defaultLayout = 'new-page ' ;
18
10
19
- protected Closure | string $ uploadDisk = 'public ' ;
20
-
21
- protected Closure | string $ uploadDirectory = 'layouts ' ;
22
-
23
- protected Closure | string $ navigationGroupLabel = 'Dynamic Dashboard ' ;
24
-
25
- protected Closure | bool $ hideLayoutResource = false ;
26
-
27
- public function models (array $ models ): static
28
- {
29
- $ this ->models = $ models ;
30
-
31
- return $ this ;
32
- }
33
-
34
- public function getModels (): array
35
- {
36
- return $ this ->models ;
37
- }
38
-
39
- public static function getModel (string $ model ): string
40
- {
41
- return array_merge (
42
- config ('zeus-dynamic-dashboard.models ' ),
43
- (new static )::get ()->getModels ()
44
- )[$ model ];
45
- }
46
-
47
- public function defaultLayout (Closure | string $ layout ): static
11
+ public function setDefaultLayout (Closure | string $ layout ): static
48
12
{
49
13
$ this ->defaultLayout = $ layout ;
50
14
@@ -55,52 +19,4 @@ public function getDefaultLayout(): Closure | string
55
19
{
56
20
return $ this ->evaluate ($ this ->defaultLayout );
57
21
}
58
-
59
- public function uploadDisk (Closure | string $ disk ): static
60
- {
61
- $ this ->uploadDisk = $ disk ;
62
-
63
- return $ this ;
64
- }
65
-
66
- public function getUploadDisk (): Closure | string
67
- {
68
- return $ this ->evaluate ($ this ->uploadDisk );
69
- }
70
-
71
- public function uploadDirectory (Closure | string $ dir ): static
72
- {
73
- $ this ->uploadDirectory = $ dir ;
74
-
75
- return $ this ;
76
- }
77
-
78
- public function getUploadDirectory (): Closure | string
79
- {
80
- return $ this ->evaluate ($ this ->uploadDirectory );
81
- }
82
-
83
- public function navigationGroupLabel (Closure | string $ lable ): static
84
- {
85
- $ this ->navigationGroupLabel = $ lable ;
86
-
87
- return $ this ;
88
- }
89
-
90
- public function getNavigationGroupLabel (): Closure | string
91
- {
92
- return $ this ->evaluate ($ this ->navigationGroupLabel );
93
- }
94
-
95
- public function hideLayoutResource (Closure | bool $ condition = true ): static
96
- {
97
- $ this ->hideLayoutResource = $ condition ;
98
-
99
- return $ this ;
100
- }
101
-
102
- public function isLayoutResourceHidden (): Closure | bool
103
- {
104
- return $ this ->evaluate ($ this ->hideLayoutResource );
105
- }
106
22
}
0 commit comments