From 77d76ee4f8edea213f3ccd8b48fbfa69fe727bcb Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Sun, 4 Jun 2023 19:36:31 +0700 Subject: [PATCH] moved frontend page folder to customer folder --- app/Http/Controllers/Customer/AuthController.php | 4 ++-- app/Http/Controllers/Customer/CartController.php | 2 +- app/Http/Controllers/Customer/CoinController.php | 4 ++-- app/Http/Controllers/Customer/DepositController.php | 8 ++++---- app/Http/Controllers/Customer/HomeController.php | 4 ++-- app/Http/Controllers/Customer/ProfileController.php | 6 +++--- app/Http/Controllers/Customer/TransactionController.php | 4 ++-- resources/js/{Pages/Home => Customer}/Auth/Login.jsx | 0 resources/js/{Pages/Home => Customer}/Auth/Register.jsx | 0 resources/js/{Pages/Home => Customer}/Base.jsx | 0 resources/js/{Pages/Home => Customer}/Cart/Index.jsx | 0 .../js/{Pages/Home => Customer}/Cart/VoucherCard.jsx | 0 resources/js/{Pages/Home => Customer}/Coin/Detail.jsx | 0 resources/js/{Pages/Home => Customer}/Coin/Index.jsx | 0 resources/js/{Pages/Home => Customer}/Deposit/Detail.jsx | 0 resources/js/{Pages/Home => Customer}/Deposit/Index.jsx | 0 resources/js/{Pages/Home => Customer}/Deposit/Topup.jsx | 0 .../js/{Pages/Home => Customer}/Index/BalanceBanner.jsx | 0 resources/js/{Pages/Home => Customer}/Index/Banner.jsx | 0 resources/js/{Pages/Home => Customer}/Index/Index.jsx | 0 .../js/{Pages/Home => Customer}/Index/UserBanner.jsx | 0 .../js/{Pages/Home => Customer}/Index/VoucherCard.jsx | 0 resources/js/{Pages/Home => Customer}/Profile/Form.jsx | 0 resources/js/{Pages/Home => Customer}/Profile/Index.jsx | 0 resources/js/{Pages/Home => Customer}/Trx/Detail.jsx | 0 resources/js/{Pages/Home => Customer}/Trx/Index.jsx | 0 resources/js/{Pages/Home => Customer}/Trx/VoucherCard.jsx | 0 resources/js/app.jsx | 4 ++-- resources/views/app.blade.php | 2 +- 29 files changed, 19 insertions(+), 19 deletions(-) rename resources/js/{Pages/Home => Customer}/Auth/Login.jsx (100%) rename resources/js/{Pages/Home => Customer}/Auth/Register.jsx (100%) rename resources/js/{Pages/Home => Customer}/Base.jsx (100%) rename resources/js/{Pages/Home => Customer}/Cart/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Cart/VoucherCard.jsx (100%) rename resources/js/{Pages/Home => Customer}/Coin/Detail.jsx (100%) rename resources/js/{Pages/Home => Customer}/Coin/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Deposit/Detail.jsx (100%) rename resources/js/{Pages/Home => Customer}/Deposit/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Deposit/Topup.jsx (100%) rename resources/js/{Pages/Home => Customer}/Index/BalanceBanner.jsx (100%) rename resources/js/{Pages/Home => Customer}/Index/Banner.jsx (100%) rename resources/js/{Pages/Home => Customer}/Index/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Index/UserBanner.jsx (100%) rename resources/js/{Pages/Home => Customer}/Index/VoucherCard.jsx (100%) rename resources/js/{Pages/Home => Customer}/Profile/Form.jsx (100%) rename resources/js/{Pages/Home => Customer}/Profile/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Trx/Detail.jsx (100%) rename resources/js/{Pages/Home => Customer}/Trx/Index.jsx (100%) rename resources/js/{Pages/Home => Customer}/Trx/VoucherCard.jsx (100%) diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 5218fc6..3d38b77 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -27,7 +27,7 @@ class AuthController extends Controller public function login() { - return inertia('Home/Auth/Login'); + return inertia('Auth/Login'); } public function update(Request $request) @@ -85,7 +85,7 @@ class AuthController extends Controller public function register() { - return inertia('Home/Auth/Register'); + return inertia('Auth/Register'); } public function store(Request $request) diff --git a/app/Http/Controllers/Customer/CartController.php b/app/Http/Controllers/Customer/CartController.php index 3696eeb..3c6d597 100644 --- a/app/Http/Controllers/Customer/CartController.php +++ b/app/Http/Controllers/Customer/CartController.php @@ -26,7 +26,7 @@ class CartController extends Controller return $item['quantity'] * $item['voucher']->price; }); - return inertia('Home/Cart/Index', [ + return inertia('Cart/Index', [ 'carts' => $carts, 'total' => $total, ]); diff --git a/app/Http/Controllers/Customer/CoinController.php b/app/Http/Controllers/Customer/CoinController.php index e2adcbc..900c02e 100644 --- a/app/Http/Controllers/Customer/CoinController.php +++ b/app/Http/Controllers/Customer/CoinController.php @@ -13,14 +13,14 @@ class CoinController extends Controller $coins = CoinHistory::where('customer_id', auth()->id()) ->orderBy('updated_at', 'desc'); - return inertia('Home/Coin/Index', [ + return inertia('Coin/Index', [ 'coins' => $coins->paginate(20), ]); } public function show(CoinHistory $coin) { - return inertia('Home/Coin/Detail', [ + return inertia('Coin/Detail', [ 'coin' => $coin, ]); } diff --git a/app/Http/Controllers/Customer/DepositController.php b/app/Http/Controllers/Customer/DepositController.php index 3473c99..e9f5c84 100644 --- a/app/Http/Controllers/Customer/DepositController.php +++ b/app/Http/Controllers/Customer/DepositController.php @@ -21,14 +21,14 @@ class DepositController extends Controller ->orderBy('updated_at', 'desc') ->orderBy('is_valid', 'desc'); - return inertia('Home/Deposit/Index', [ + return inertia('Deposit/Index', [ 'histories' => $histories->paginate(20), ]); } public function create() { - return inertia('Home/Deposit/Topup', [ + return inertia('Deposit/Topup', [ 'payments' => GeneralService::getEnablePayment(), ]); } @@ -47,7 +47,7 @@ class DepositController extends Controller $deposit = DepositHistory::make([ 'customer_id' => auth()->id(), 'debit' => $request->amount, - 'description' => 'Top Up #'.Str::random(5), + 'description' => 'Top Up #' . Str::random(5), 'payment_channel' => $request->payment, ]); @@ -72,7 +72,7 @@ class DepositController extends Controller public function show(Request $request, DepositHistory $deposit) { - return inertia('Home/Deposit/Detail', [ + return inertia('Deposit/Detail', [ 'deposit' => $deposit, 'accounts' => Account::get(), 'midtrans_client_key' => Setting::getByKey('MIDTRANS_CLIENT_KEY'), diff --git a/app/Http/Controllers/Customer/HomeController.php b/app/Http/Controllers/Customer/HomeController.php index b443a8d..450071d 100644 --- a/app/Http/Controllers/Customer/HomeController.php +++ b/app/Http/Controllers/Customer/HomeController.php @@ -25,7 +25,7 @@ class HomeController extends Controller $vouchers->where('location_id', $request->location_id); } - return inertia('Home/Index/Index', [ + return inertia('Index/Index', [ 'infos' => $infos, 'banners' => $banners, 'locations' => $locations, @@ -36,7 +36,7 @@ class HomeController extends Controller public function banner(Banner $banner) { - return inertia('Home/Index/Banner', [ + return inertia('Index/Banner', [ 'banner' => $banner, ]); } diff --git a/app/Http/Controllers/Customer/ProfileController.php b/app/Http/Controllers/Customer/ProfileController.php index c1657fe..c4035f3 100644 --- a/app/Http/Controllers/Customer/ProfileController.php +++ b/app/Http/Controllers/Customer/ProfileController.php @@ -9,12 +9,12 @@ class ProfileController extends Controller { public function index() { - return inertia('Home/Profile/Index'); + return inertia('Profile/Index'); } public function show() { - return inertia('Home/Profile/Form'); + return inertia('Profile/Form'); } public function update(Request $request) @@ -26,7 +26,7 @@ class ProfileController extends Controller 'name' => 'string|required', 'address' => 'string|required', 'phone' => 'string|required|numeric', - 'username' => 'string|required|min:5|alpha_dash|unique:customers,username,'.$customer->id, + 'username' => 'string|required|min:5|alpha_dash|unique:customers,username,' . $customer->id, 'password' => 'nullable|string|min:8|confirmed', 'image' => 'nullable|image', ]); diff --git a/app/Http/Controllers/Customer/TransactionController.php b/app/Http/Controllers/Customer/TransactionController.php index 95e5bd0..943786e 100644 --- a/app/Http/Controllers/Customer/TransactionController.php +++ b/app/Http/Controllers/Customer/TransactionController.php @@ -12,14 +12,14 @@ class TransactionController extends Controller $query = Sale::where('customer_id', auth()->id()) ->orderBy('created_at', 'desc'); - return inertia('Home/Trx/Index', [ + return inertia('Trx/Index', [ 'query' => $query->paginate(), ]); } public function show(Sale $sale) { - return inertia('Home/Trx/Detail', [ + return inertia('Trx/Detail', [ 'sale' => $sale->load(['items.voucher.location']) ]); } diff --git a/resources/js/Pages/Home/Auth/Login.jsx b/resources/js/Customer/Auth/Login.jsx similarity index 100% rename from resources/js/Pages/Home/Auth/Login.jsx rename to resources/js/Customer/Auth/Login.jsx diff --git a/resources/js/Pages/Home/Auth/Register.jsx b/resources/js/Customer/Auth/Register.jsx similarity index 100% rename from resources/js/Pages/Home/Auth/Register.jsx rename to resources/js/Customer/Auth/Register.jsx diff --git a/resources/js/Pages/Home/Base.jsx b/resources/js/Customer/Base.jsx similarity index 100% rename from resources/js/Pages/Home/Base.jsx rename to resources/js/Customer/Base.jsx diff --git a/resources/js/Pages/Home/Cart/Index.jsx b/resources/js/Customer/Cart/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Cart/Index.jsx rename to resources/js/Customer/Cart/Index.jsx diff --git a/resources/js/Pages/Home/Cart/VoucherCard.jsx b/resources/js/Customer/Cart/VoucherCard.jsx similarity index 100% rename from resources/js/Pages/Home/Cart/VoucherCard.jsx rename to resources/js/Customer/Cart/VoucherCard.jsx diff --git a/resources/js/Pages/Home/Coin/Detail.jsx b/resources/js/Customer/Coin/Detail.jsx similarity index 100% rename from resources/js/Pages/Home/Coin/Detail.jsx rename to resources/js/Customer/Coin/Detail.jsx diff --git a/resources/js/Pages/Home/Coin/Index.jsx b/resources/js/Customer/Coin/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Coin/Index.jsx rename to resources/js/Customer/Coin/Index.jsx diff --git a/resources/js/Pages/Home/Deposit/Detail.jsx b/resources/js/Customer/Deposit/Detail.jsx similarity index 100% rename from resources/js/Pages/Home/Deposit/Detail.jsx rename to resources/js/Customer/Deposit/Detail.jsx diff --git a/resources/js/Pages/Home/Deposit/Index.jsx b/resources/js/Customer/Deposit/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Deposit/Index.jsx rename to resources/js/Customer/Deposit/Index.jsx diff --git a/resources/js/Pages/Home/Deposit/Topup.jsx b/resources/js/Customer/Deposit/Topup.jsx similarity index 100% rename from resources/js/Pages/Home/Deposit/Topup.jsx rename to resources/js/Customer/Deposit/Topup.jsx diff --git a/resources/js/Pages/Home/Index/BalanceBanner.jsx b/resources/js/Customer/Index/BalanceBanner.jsx similarity index 100% rename from resources/js/Pages/Home/Index/BalanceBanner.jsx rename to resources/js/Customer/Index/BalanceBanner.jsx diff --git a/resources/js/Pages/Home/Index/Banner.jsx b/resources/js/Customer/Index/Banner.jsx similarity index 100% rename from resources/js/Pages/Home/Index/Banner.jsx rename to resources/js/Customer/Index/Banner.jsx diff --git a/resources/js/Pages/Home/Index/Index.jsx b/resources/js/Customer/Index/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Index/Index.jsx rename to resources/js/Customer/Index/Index.jsx diff --git a/resources/js/Pages/Home/Index/UserBanner.jsx b/resources/js/Customer/Index/UserBanner.jsx similarity index 100% rename from resources/js/Pages/Home/Index/UserBanner.jsx rename to resources/js/Customer/Index/UserBanner.jsx diff --git a/resources/js/Pages/Home/Index/VoucherCard.jsx b/resources/js/Customer/Index/VoucherCard.jsx similarity index 100% rename from resources/js/Pages/Home/Index/VoucherCard.jsx rename to resources/js/Customer/Index/VoucherCard.jsx diff --git a/resources/js/Pages/Home/Profile/Form.jsx b/resources/js/Customer/Profile/Form.jsx similarity index 100% rename from resources/js/Pages/Home/Profile/Form.jsx rename to resources/js/Customer/Profile/Form.jsx diff --git a/resources/js/Pages/Home/Profile/Index.jsx b/resources/js/Customer/Profile/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Profile/Index.jsx rename to resources/js/Customer/Profile/Index.jsx diff --git a/resources/js/Pages/Home/Trx/Detail.jsx b/resources/js/Customer/Trx/Detail.jsx similarity index 100% rename from resources/js/Pages/Home/Trx/Detail.jsx rename to resources/js/Customer/Trx/Detail.jsx diff --git a/resources/js/Pages/Home/Trx/Index.jsx b/resources/js/Customer/Trx/Index.jsx similarity index 100% rename from resources/js/Pages/Home/Trx/Index.jsx rename to resources/js/Customer/Trx/Index.jsx diff --git a/resources/js/Pages/Home/Trx/VoucherCard.jsx b/resources/js/Customer/Trx/VoucherCard.jsx similarity index 100% rename from resources/js/Pages/Home/Trx/VoucherCard.jsx rename to resources/js/Customer/Trx/VoucherCard.jsx diff --git a/resources/js/app.jsx b/resources/js/app.jsx index c56bcd5..06fc41d 100644 --- a/resources/js/app.jsx +++ b/resources/js/app.jsx @@ -16,8 +16,8 @@ createInertiaApp({ title: (title) => `${title} - ${appName}`, resolve: (name) => resolvePageComponent( - `./Pages/${name}.jsx`, - import.meta.glob('./Pages/**/*.jsx') + `./Customer/${name}.jsx`, + import.meta.glob('./Customer/**/*.jsx') ), setup({ el, App, props }) { const root = createRoot(el) diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index fedf922..61debb9 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -15,7 +15,7 @@ @routes @viteReactRefresh - @vite(['resources/js/app.jsx', "resources/js/Pages/{$page['component']}.jsx"]) + @vite(['resources/js/app.jsx', "resources/js/Customer/{$page['component']}.jsx"]) @inertiaHead