File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Support \Facades \Facade ;
66
77/**
8- * @method static void set($key, $value)
9- * @method static mixed get($key, $default = null)
8+ * @method static void set(string $key, $value)
9+ * @method static mixed get(string $key, $default = null)
10+ * @method static void forget(string $key)
11+ * @method static void clear()
1012 */
1113class Settings extends Facade
1214{
Original file line number Diff line number Diff line change @@ -8,15 +8,25 @@ class Settings
88{
99 public function __construct (protected Client $ client ) {}
1010
11- public function set ($ key , $ value ): void
11+ public function set (string $ key , $ value ): void
1212 {
1313 $ this ->client ->post ('settings/ ' .$ key , [
1414 'value ' => $ value ,
1515 ]);
1616 }
1717
18- public function get ($ key , $ default = null ): mixed
18+ public function get (string $ key , $ default = null ): mixed
1919 {
2020 return $ this ->client ->get ('settings/ ' .$ key )->json ('value ' ) ?? $ default ;
2121 }
22+
23+ public function forget (string $ key ): void
24+ {
25+ $ this ->client ->delete ('settings/ ' .$ key );
26+ }
27+
28+ public function clear (): void
29+ {
30+ $ this ->client ->delete ('settings/ ' );
31+ }
2232}
You can’t perform that action at this time.
0 commit comments