File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Native \Laravel \Enums ;
4
+
5
+ enum SystemThemesEnum: string
6
+ {
7
+ case SYSTEM = 'system ' ;
8
+ case LIGHT = 'light ' ;
9
+ case DARK = 'dark ' ;
10
+ }
Original file line number Diff line number Diff line change 3
3
namespace Native \Laravel \Facades ;
4
4
5
5
use Illuminate \Support \Facades \Facade ;
6
+ use Native \Laravel \Enums \SystemThemesEnum ;
6
7
7
8
/**
8
9
* @method static bool canPromptTouchID()
14
15
* @method static void print(string $html, ?\Native\Laravel\DataObjects\Printer $printer = null)
15
16
* @method static string printToPDF(string $reason)
16
17
* @method static string timezone()
18
+ * @method static SystemThemesEnum theme(?SystemThemesEnum $theme = null)
17
19
*/
18
20
class System extends Facade
19
21
{
Original file line number Diff line number Diff line change 4
4
5
5
use Native \Laravel \Client \Client ;
6
6
use Native \Laravel \DataObjects \Printer ;
7
+ use Native \Laravel \Enums \SystemThemesEnum ;
7
8
use Native \Laravel \Support \Environment ;
8
9
use Native \Laravel \Support \Timezones ;
9
10
@@ -88,4 +89,17 @@ public function timezone(): string
88
89
89
90
return $ timezone ;
90
91
}
92
+
93
+ public function theme (?SystemThemesEnum $ theme = null ): SystemThemesEnum
94
+ {
95
+ if ($ theme ) {
96
+ $ result = $ this ->client ->post ('system/theme ' , [
97
+ 'theme ' => $ theme ,
98
+ ])->json ('result ' );
99
+ } else {
100
+ $ result = $ this ->client ->get ('system/theme ' )->json ('result ' );
101
+ }
102
+
103
+ return SystemThemesEnum::from ($ result );
104
+ }
91
105
}
You can’t perform that action at this time.
0 commit comments