forked from NativePHP/laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShell.php
38 lines (31 loc) · 802 Bytes
/
Shell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Native\Laravel;
use Native\Laravel\Client\Client;
class Shell
{
public function __construct(protected Client $client) {}
public function showInFolder(string $path): void
{
$this->client->post('shell/show-item-in-folder', [
'path' => $path,
]);
}
public function openFile(string $path): string
{
return $this->client->post('shell/open-item', [
'path' => $path,
])->json('result');
}
public function trashFile(string $path): void
{
$this->client->delete('shell/trash-item', [
'path' => $path,
]);
}
public function openExternal(string $url): void
{
$this->client->post('shell/open-external', [
'url' => $url,
]);
}
}