From 1101c82e0233e6b2c9f538153f97b072fffb4cac Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Wed, 24 May 2023 22:29:20 +0700 Subject: [PATCH] bit fix on build --- resources/js/Layouts/Partials/routes.js | 51 ++++++++----------------- routes/admin.php | 9 +++-- vite.config.js | 14 ++++--- 3 files changed, 29 insertions(+), 45 deletions(-) diff --git a/resources/js/Layouts/Partials/routes.js b/resources/js/Layouts/Partials/routes.js index c4b349e..53f09b7 100644 --- a/resources/js/Layouts/Partials/routes.js +++ b/resources/js/Layouts/Partials/routes.js @@ -1,56 +1,35 @@ -import { - HiChartPie, - HiUser, - HiCollection, - HiAdjustments, - HiPlusCircle, - HiCurrencyDollar, - HiCash, - HiClipboardList, - HiHashtag, - HiUsers, - HiUserGroup, - HiUserCircle, - HiOutlineTruck, - HiDatabase, - HiShoppingBag, - HiReceiptTax, - HiHome, - HiInboxIn, - HiOutlineCash, - HiOutlineTable -} from "react-icons/hi"; +import { HiChartPie, HiUser, HiUsers, HiUserGroup } from 'react-icons/hi' export default [ { - name: "Dashboard", + name: 'Dashboard', show: true, icon: HiChartPie, - route: route("dashboard"), - active: "dashboard", - permission: "view-dashboard", + route: route('dashboard'), + active: 'dashboard', + permission: 'view-dashboard', }, { - name: "User", + name: 'User', show: true, icon: HiUser, items: [ { - name: "Roles", + name: 'Roles', show: true, icon: HiUserGroup, - route: route("roles.index"), - active: "roles.*", - permission: "view-role", + route: route('roles.index'), + active: 'roles.*', + permission: 'view-role', }, { - name: "Users", + name: 'Users', show: true, icon: HiUsers, - route: route("user.index"), - active: "user.index", - permission: "view-user", + route: route('user.index'), + active: 'user.index', + permission: 'view-user', }, ], }, -]; +] diff --git a/routes/admin.php b/routes/admin.php index cc03a84..d324a37 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -10,6 +10,8 @@ use Illuminate\Support\Facades\Route; Route::middleware(['inertia.admin']) ->prefix('admin') ->group(function () { + Route::get('/', fn () => redirect()->route('admin.login')); + Route::middleware(['guest:web'])->group(function () { Route::get('login', [AuthenticatedSessionController::class, 'create']) ->name('admin.login'); @@ -17,8 +19,8 @@ Route::middleware(['inertia.admin']) Route::post('login', [AuthenticatedSessionController::class, 'store']); }); - Route::middleware(['auth'])->group(function () { - + Route::middleware(['auth:web'])->group(function () { + // dashboard Route::get('/dashboard', [GeneralController::class, 'index'])->name('dashboard'); Route::get('/maintance', [GeneralController::class, 'maintance'])->name('maintance'); @@ -28,8 +30,7 @@ Route::middleware(['inertia.admin']) Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); // Logout - Route::post('logout', [AuthenticatedSessionController::class, 'destroy']) - ->name('logout'); + Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); // User Route::get('/users', [UserController::class, 'index'])->name('user.index'); diff --git a/vite.config.js b/vite.config.js index 24f3573..ad98020 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,13 +1,17 @@ -import { defineConfig } from 'vite'; -import laravel from 'laravel-vite-plugin'; -import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite' +import laravel from 'laravel-vite-plugin' +import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [ laravel({ - input: ["resources/css/app.css", "resources/js/app.jsx"], + input: [ + 'resources/css/app.css', + 'resources/js/app.jsx', + 'resources/js/admin.jsx', + ], refresh: true, }), react(), ], -}); +})