@@ -32,6 +32,29 @@ public function store(ThemeUpdateRequest $request)
32
32
return response ()->redirectToRoute ('admin.settings.index ' )->with ('successMessage ' , 'The theme has been created ' );
33
33
}
34
34
35
+ protected function updateObject (Theme $ theme , Request $ request )
36
+ {
37
+ $ theme ->active = (bool )$ request ->input ('active ' );
38
+ $ theme ->dark_mode = (bool )$ request ->input ('dark_mode ' );
39
+ if (!$ theme ->readonly ) {
40
+ $ map = [
41
+ 'name ' ,
42
+ 'css ' ,
43
+ 'primary ' ,
44
+ 'nav_background ' ,
45
+ 'seat_available ' ,
46
+ 'seat_disabled ' ,
47
+ 'seat_taken ' ,
48
+ 'seat_clan ' ,
49
+ 'seat_selected ' ,
50
+ ];
51
+ foreach ($ map as $ prop ) {
52
+ $ theme ->{$ prop } = $ request ->input ($ prop );
53
+ }
54
+ }
55
+ $ theme ->save ();
56
+ }
57
+
35
58
public function edit (Theme $ theme )
36
59
{
37
60
return view ('admin.themes.edit ' , [
@@ -45,16 +68,6 @@ public function update(ThemeUpdateRequest $request, Theme $theme)
45
68
return response ()->redirectToRoute ('admin.settings.index ' )->with ('successMessage ' , 'The theme has been updated ' );
46
69
}
47
70
48
- public function delete (Theme $ theme )
49
- {
50
- if ($ theme ->readonly ) {
51
- abort (400 );
52
- }
53
- return view ('admin.themes.delete ' , [
54
- 'theme ' => $ theme ,
55
- ]);
56
- }
57
-
58
71
public function destroy (Theme $ theme )
59
72
{
60
73
if ($ theme ->readonly ) {
@@ -64,26 +77,13 @@ public function destroy(Theme $theme)
64
77
return response ()->redirectToRoute ('admin.settings.index ' )->with ('successMessage ' , 'The theme has been deleted ' );
65
78
}
66
79
67
- protected function updateObject (Theme $ theme, Request $ request )
80
+ public function delete (Theme $ theme )
68
81
{
69
- $ theme ->active = (bool )$ request ->input ('active ' );
70
- $ theme ->dark_mode = (bool )$ request ->input ('dark_mode ' );
71
- if (!$ theme ->readonly ) {
72
- $ map = [
73
- 'name ' ,
74
- 'css ' ,
75
- 'primary ' ,
76
- 'nav_background ' ,
77
- 'seat_available ' ,
78
- 'seat_disabled ' ,
79
- 'seat_taken ' ,
80
- 'seat_clan ' ,
81
- 'seat_selected ' ,
82
- ];
83
- foreach ($ map as $ prop ) {
84
- $ theme ->{$ prop } = $ request ->input ($ prop );
85
- }
82
+ if ($ theme ->readonly ) {
83
+ abort (400 );
86
84
}
87
- $ theme ->save ();
85
+ return view ('admin.themes.delete ' , [
86
+ 'theme ' => $ theme ,
87
+ ]);
88
88
}
89
89
}
0 commit comments