File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 5
5
use Illuminate \Support \Facades \Facade ;
6
6
7
7
/**
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()
10
12
*/
11
13
class Settings extends Facade
12
14
{
Original file line number Diff line number Diff line change @@ -8,15 +8,25 @@ class Settings
8
8
{
9
9
public function __construct (protected Client $ client ) {}
10
10
11
- public function set ($ key , $ value ): void
11
+ public function set (string $ key , $ value ): void
12
12
{
13
13
$ this ->client ->post ('settings/ ' .$ key , [
14
14
'value ' => $ value ,
15
15
]);
16
16
}
17
17
18
- public function get ($ key , $ default = null ): mixed
18
+ public function get (string $ key , $ default = null ): mixed
19
19
{
20
20
return $ this ->client ->get ('settings/ ' .$ key )->json ('value ' ) ?? $ default ;
21
21
}
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
+ }
22
32
}
You can’t perform that action at this time.
0 commit comments