Skip to content

Commit a84e66d

Browse files
committed
Test it can import storage routes
1 parent fe3e183 commit a84e66d

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

testbench.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
providers:
2-
# - Workbench\App\Providers\WorkbenchServiceProvider
2+
- App\Providers\WorkbenchServiceProvider
33

44
workbench:
55
start: '/'

tests/StorageRoute.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { expect, it } from "vitest";
2+
import storage from "../workbench/resources/js/routes/storage";
3+
4+
it("can import storage routes", () => {
5+
expect(storage.export('file-name')).toEqual({
6+
url: "/storage/file-name",
7+
method: "get",
8+
});
9+
});

workbench/app/Providers/WorkbenchServiceProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Providers;
44

5+
use Illuminate\Support\Facades\Config;
56
use Illuminate\Support\ServiceProvider;
67

78
class WorkbenchServiceProvider extends ServiceProvider
@@ -11,7 +12,14 @@ class WorkbenchServiceProvider extends ServiceProvider
1112
*/
1213
public function register(): void
1314
{
14-
//
15+
Config::set([
16+
'filesystems.disks.export' => [
17+
'driver' => 'local',
18+
'root' => database_path('data/exports'),
19+
'serve' => true,
20+
'throw' => false,
21+
],
22+
]);
1523
}
1624

1725
/**

0 commit comments

Comments
 (0)