File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 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 33namespace Native \Laravel \Facades ;
44
55use Illuminate \Support \Facades \Facade ;
6+ use Native \Laravel \Enums \SystemThemesEnum ;
67
78/**
89 * @method static bool canPromptTouchID()
1415 * @method static void print(string $html, ?\Native\Laravel\DataObjects\Printer $printer = null)
1516 * @method static string printToPDF(string $reason)
1617 * @method static string timezone()
18+ * @method static SystemThemesEnum theme(?SystemThemesEnum $theme = null)
1719 */
1820class System extends Facade
1921{
Original file line number Diff line number Diff line change 44
55use Native \Laravel \Client \Client ;
66use Native \Laravel \DataObjects \Printer ;
7+ use Native \Laravel \Enums \SystemThemesEnum ;
78use Native \Laravel \Support \Environment ;
89use Native \Laravel \Support \Timezones ;
910
@@ -88,4 +89,17 @@ public function timezone(): string
8889
8990 return $ timezone ;
9091 }
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+ }
91105}
You can’t perform that action at this time.
0 commit comments