浏览代码

fix: vite frontend tooling

父节点
当前提交
b9e404f6f1

+ 6
- 0
.env.example 查看文件

@@ -46,7 +46,13 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
46 46
 PUSHER_APP_ID=
47 47
 PUSHER_APP_KEY=
48 48
 PUSHER_APP_SECRET=
49
+PUSHER_HOST=
50
+PUSHER_PORT=443
51
+PUSHER_SCHEME=https
49 52
 PUSHER_APP_CLUSTER=mt1
50 53
 
51 54
 VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
55
+VITE_PUSHER_HOST="${PUSHER_HOST}"
56
+VITE_PUSHER_PORT="${PUSHER_PORT}"
57
+VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
52 58
 VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

+ 2
- 2
app/Http/Controllers/CustomerController.php 查看文件

@@ -20,7 +20,7 @@ class CustomerController extends Controller
20 20
      */
21 21
     public function index()
22 22
     {
23
-        return inertia('Customers/Index.vue', [
23
+        return inertia('Customers/Index', [
24 24
             'initialSearch' => request('search'),
25 25
             'customers' => Customer::filter(request()->only('search'))
26 26
                 ->latest()
@@ -79,7 +79,7 @@ class CustomerController extends Controller
79 79
      */
80 80
     public function edit(Customer $customer)
81 81
     {
82
-        return inertia('Customers/Edit.vue', compact('customer'));
82
+        return inertia('Customers/Edit', compact('customer'));
83 83
     }
84 84
 
85 85
     /**

+ 1
- 1
app/Http/Controllers/DashboardController.php 查看文件

@@ -14,6 +14,6 @@ class DashboardController extends Controller
14 14
      */
15 15
     public function __invoke(Request $request)
16 16
     {
17
-        return inertia('Dashboards/Index.vue');
17
+        return inertia('Dashboards/Index');
18 18
     }
19 19
 }

+ 1
- 1
app/Http/Controllers/PurchaseController.php 查看文件

@@ -27,7 +27,7 @@ class PurchaseController extends Controller
27 27
      */
28 28
     public function index()
29 29
     {
30
-        return inertia('Purchases/Index.vue', [
30
+        return inertia('Purchases/Index', [
31 31
             'initialSearch' => request('search'),
32 32
             'purchases' => Purchase::filter(request()->only('search'))
33 33
                 ->latest()

+ 2
- 2
app/Http/Controllers/SupplierController.php 查看文件

@@ -20,7 +20,7 @@ class SupplierController extends Controller
20 20
      */
21 21
     public function index()
22 22
     {
23
-        return inertia('Suppliers/Index.vue', [
23
+        return inertia('Suppliers/Index', [
24 24
             'initialSearch' => request('search'),
25 25
             'suppliers' => Supplier::filter(request()->only('search'))
26 26
                 ->latest()
@@ -80,7 +80,7 @@ class SupplierController extends Controller
80 80
      */
81 81
     public function edit(Supplier $supplier)
82 82
     {
83
-        return inertia('Suppliers/Edit.vue', compact('supplier'));
83
+        return inertia('Suppliers/Edit', compact('supplier'));
84 84
     }
85 85
 
86 86
     /**

+ 2
- 2
composer.json 查看文件

@@ -8,11 +8,11 @@
8 8
   ],
9 9
   "license": "MIT",
10 10
   "require": {
11
-    "php": "^8.0|^8.1",
11
+    "php": "^8.0.2",
12 12
     "fruitcake/laravel-cors": "^2.0.5",
13 13
     "guzzlehttp/guzzle": "^7.2",
14 14
     "inertiajs/inertia-laravel": "^0.5.4",
15
-    "laravel/framework": "^9.0",
15
+    "laravel/framework": "^9.19",
16 16
     "laravel/sanctum": "^2.14",
17 17
     "laravel/tinker": "^2.7",
18 18
     "maatwebsite/excel": "^3.1",

+ 13
- 13
composer.lock 查看文件

@@ -4,7 +4,7 @@
4 4
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "content-hash": "c95b0e2a152a8654b1f0ff918e5d0d09",
7
+    "content-hash": "cf9797e5b5b20287f0213c45da310a85",
8 8
     "packages": [
9 9
         {
10 10
             "name": "asm89/stack-cors",
@@ -1709,16 +1709,16 @@
1709 1709
         },
1710 1710
         {
1711 1711
             "name": "league/flysystem",
1712
-            "version": "3.0.23",
1712
+            "version": "3.1.0",
1713 1713
             "source": {
1714 1714
                 "type": "git",
1715 1715
                 "url": "https://github.com/thephpleague/flysystem.git",
1716
-                "reference": "5b461a96d01144744077343908a2c196682c71e6"
1716
+                "reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5"
1717 1717
             },
1718 1718
             "dist": {
1719 1719
                 "type": "zip",
1720
-                "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/5b461a96d01144744077343908a2c196682c71e6",
1721
-                "reference": "5b461a96d01144744077343908a2c196682c71e6",
1720
+                "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/34a68067b7ae3b836ea5e57e1fc432478372a4f5",
1721
+                "reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5",
1722 1722
                 "shasum": ""
1723 1723
             },
1724 1724
             "require": {
@@ -1779,7 +1779,7 @@
1779 1779
             ],
1780 1780
             "support": {
1781 1781
                 "issues": "https://github.com/thephpleague/flysystem/issues",
1782
-                "source": "https://github.com/thephpleague/flysystem/tree/3.0.23"
1782
+                "source": "https://github.com/thephpleague/flysystem/tree/3.1.0"
1783 1783
             },
1784 1784
             "funding": [
1785 1785
                 {
@@ -1795,7 +1795,7 @@
1795 1795
                     "type": "tidelift"
1796 1796
                 }
1797 1797
             ],
1798
-            "time": "2022-06-29T08:19:13+00:00"
1798
+            "time": "2022-06-29T17:29:54+00:00"
1799 1799
         },
1800 1800
         {
1801 1801
             "name": "league/mime-type-detection",
@@ -2277,16 +2277,16 @@
2277 2277
         },
2278 2278
         {
2279 2279
             "name": "nesbot/carbon",
2280
-            "version": "2.59.0",
2280
+            "version": "2.59.1",
2281 2281
             "source": {
2282 2282
                 "type": "git",
2283 2283
                 "url": "https://github.com/briannesbitt/Carbon.git",
2284
-                "reference": "9cea2f72585a46d0651ee6d4c8c8f752e78c16c6"
2284
+                "reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5"
2285 2285
             },
2286 2286
             "dist": {
2287 2287
                 "type": "zip",
2288
-                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/9cea2f72585a46d0651ee6d4c8c8f752e78c16c6",
2289
-                "reference": "9cea2f72585a46d0651ee6d4c8c8f752e78c16c6",
2288
+                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/a9000603ea337c8df16cc41f8b6be95a65f4d0f5",
2289
+                "reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5",
2290 2290
                 "shasum": ""
2291 2291
             },
2292 2292
             "require": {
@@ -2375,7 +2375,7 @@
2375 2375
                     "type": "tidelift"
2376 2376
                 }
2377 2377
             ],
2378
-            "time": "2022-06-26T20:26:59+00:00"
2378
+            "time": "2022-06-29T21:43:55+00:00"
2379 2379
         },
2380 2380
         {
2381 2381
             "name": "nette/schema",
@@ -8513,7 +8513,7 @@
8513 8513
     "prefer-stable": true,
8514 8514
     "prefer-lowest": false,
8515 8515
     "platform": {
8516
-        "php": "^8.0|^8.1"
8516
+        "php": "^8.0.2"
8517 8517
     },
8518 8518
     "platform-dev": [],
8519 8519
     "plugin-api-version": "2.3.0"

+ 346
- 4686
package-lock.json
文件差异内容过多而无法显示
查看文件


+ 1
- 6
package.json 查看文件

@@ -11,8 +11,6 @@
11 11
     "@inertiajs/progress": "^0.2.7",
12 12
     "@vitejs/plugin-vue": "^2.3.3",
13 13
     "axios": "^0.25",
14
-    "browser-sync": "^2.27.7",
15
-    "browser-sync-webpack-plugin": "^2.3.0",
16 14
     "chart.js": "^3.7.1",
17 15
     "dayjs": "^1.11.0",
18 16
     "laravel-vite-plugin": "^0.2.3",
@@ -22,11 +20,8 @@
22 20
     "primeicons": "^5.0.0",
23 21
     "primevue": "^3.15.0",
24 22
     "quill": "^1.3.7",
25
-    "resolve-url-loader": "^5.0.0",
26 23
     "sass": "^1.49.8",
27
-    "sass-loader": "^12.1.0",
28 24
     "vite": "^2.9.13",
29
-    "vue": "^3.2.31",
30
-    "vue-loader": "^16.2.0"
25
+    "vue": "^3.2.31"
31 26
   }
32 27
 }

+ 31
- 0
resources/js/bootstrap.js 查看文件

@@ -0,0 +1,31 @@
1
+/**
2
+ * We'll load the axios HTTP library which allows us to easily issue requests
3
+ * to our Laravel back-end. This library automatically handles sending the
4
+ * CSRF token as a header based on the value of the "XSRF" token cookie.
5
+ */
6
+
7
+import axios from 'axios'
8
+window.axios = axios
9
+
10
+window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
11
+
12
+/**
13
+ * Echo exposes an expressive API for subscribing to channels and listening
14
+ * for events that are broadcast by Laravel. Echo and event broadcasting
15
+ * allows your team to easily build robust real-time web applications.
16
+ */
17
+
18
+// import Echo from 'laravel-echo';
19
+
20
+// import Pusher from 'pusher-js';
21
+// window.Pusher = Pusher;
22
+
23
+// window.Echo = new Echo({
24
+//     broadcaster: 'pusher',
25
+//     key: import.meta.env.VITE_PUSHER_APP_KEY,
26
+//     wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_CLUSTER}.pusher.com`,
27
+//     wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
28
+//     wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
29
+//     forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
30
+//     enabledTransports: ['ws', 'wss'],
31
+// });

+ 7
- 1
resources/js/vue.js 查看文件

@@ -1,6 +1,8 @@
1
+import './bootstrap'
1 2
 import { createApp, h } from 'vue'
2 3
 import { createInertiaApp } from '@inertiajs/inertia-vue3'
3 4
 import { InertiaProgress } from '@inertiajs/progress'
5
+import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
4 6
 
5 7
 import 'primevue/resources/themes/mdc-light-indigo/theme.css'
6 8
 import 'primevue/resources/primevue.min.css'
@@ -37,7 +39,11 @@ import Tooltip from 'primevue/tooltip'
37 39
 
38 40
 createInertiaApp({
39 41
   title: (title) => `${title} - Cahaya Agung`,
40
-  resolve: (name) => import(`./pages/${name}`),
42
+  resolve: (name) =>
43
+    resolvePageComponent(
44
+      `./pages/${name}.vue`,
45
+      import.meta.glob('./pages/**/*.vue')
46
+    ),
41 47
   setup({ el, App, props, plugin }) {
42 48
     createApp({ render: () => h(App, props) })
43 49
       .use(plugin)

+ 3
- 1
vite.config.js 查看文件

@@ -4,7 +4,9 @@ import vue from '@vitejs/plugin-vue'
4 4
 
5 5
 export default defineConfig({
6 6
   plugins: [
7
-    laravel(['resources/js/vue.js']),
7
+    laravel({
8
+      input: 'resources/js/vue.js',
9
+    }),
8 10
     vue({
9 11
       template: {
10 12
         transformAssetUrls: {