Skip to content

Commit 5385347

Browse files
authored
Safe storage (#357)
* Add safe storage methods * fix
1 parent 6d7b038 commit 5385347

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Facades/System.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
/**
88
* @method static bool canPromptTouchID()
99
* @method static bool promptTouchID(string $reason)
10+
* @method static bool canEncrypt()
11+
* @method static string encrypt(string $string)
12+
* @method static string decrypt(string $string)
1013
* @method static array printers()
1114
* @method static void print(string $html, ?\Native\Laravel\DataObjects\Printer $printer = null)
1215
* @method static string printToPDF(string $reason)

src/System.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ public function promptTouchID(string $reason): bool
2222
])->successful();
2323
}
2424

25+
public function canEncrypt(): bool
26+
{
27+
return $this->client->get('system/can-encrypt')->json('result');
28+
}
29+
30+
public function encrypt(string $string): ?string
31+
{
32+
return $this->client->post('system/encrypt', [
33+
'string' => $string,
34+
])->json('result');
35+
}
36+
37+
public function decrypt(string $string): ?string
38+
{
39+
return $this->client->post('system/decrypt', [
40+
'string' => $string,
41+
])->json('result');
42+
}
43+
2544
/**
2645
* @return array<\Native\Laravel\DataObjects\Printer>
2746
*/

0 commit comments

Comments
 (0)