laravelEcomm/routes/web.php

66 lines
2.9 KiB
PHP
Raw Normal View History

2024-07-04 04:34:45 +00:00
<?php
2024-07-12 07:06:02 +00:00
use App\Http\Controllers\AdminController;
2024-07-04 04:34:45 +00:00
use App\Http\Controllers\MainController;
2024-07-10 08:01:42 +00:00
use App\Http\Controllers\BotManController;
use App\Http\Controllers\StripePaymentController;
2024-07-10 08:01:42 +00:00
use BotMan\BotMan\Facades\BotMan;
2024-07-04 04:34:45 +00:00
use Illuminate\Support\Facades\Route;
2024-07-12 07:06:02 +00:00
2024-07-12 07:06:02 +00:00
//admin routes
Route::get('/admin', [AdminController::class, 'index'])->name('admin');
Route::get('/adminProducts', [AdminController::class, 'products'])->name('products');
Route::post('/addNewProduct', [AdminController::class, 'addNewProduct'])->name('addNewProduct');
Route::post('/updateProduct', [AdminController::class, 'updateProduct'])->name('updateProduct');
Route::get('/deleteProduct/{id}', [AdminController::class, 'deleteProduct'])->name('deleteProduct');
Route::get('/adminProfile', [AdminController::class, 'profile'])->name('adminProfile');
Route::get('/ourCustomers', [AdminController::class, 'customers'])->name('ourCustomers');
Route::get('/changeUserStatus/{status}/{id}', [AdminController::class, 'changeUserStatus'])->name('changeUserStatus');
Route::get('/changeOrderStatus/{status}/{id}', [AdminController::class, 'changeOrderStatus'])->name('changeOrderStatus');
Route::get('/ourOrders', [AdminController::class, 'orders'])->name('ourOrders');
2024-07-12 07:06:02 +00:00
//customer routes
2024-07-09 05:59:05 +00:00
Route::get('/', [MainController::class, 'index'])->name('/');
Route::get('/about', [MainController::class, 'about'])->name('about');
2024-07-04 04:34:45 +00:00
Route::get('/blog', [MainController::class, 'blog']);
2024-07-09 05:59:05 +00:00
Route::get('/profile', [MainController::class, 'profile'])->name('profile');
Route::post('/updateUser', [MainController::class, 'updateUser']);
2024-07-09 05:59:05 +00:00
Route::get('/cart', [MainController::class, 'cart'])->name('cart');
Route::post('/addToCart', [MainController::class, 'addToCart']);
2024-07-05 07:29:27 +00:00
Route::get('/deleteCartItem/{id}', [MainController::class, 'deleteCartItem']);
2024-07-07 07:21:31 +00:00
Route::post('/updateCartItem/{id}', [MainController::class, 'updateCartItem'])->name("cart.update");
2024-07-05 09:58:08 +00:00
2024-07-09 05:59:05 +00:00
Route::get('/checkout', [MainController::class, 'checkout'])->name('checkout');
Route::get('/myOrders', [MainController::class, 'myOrders'])->name('myOrders');
2024-07-04 07:19:28 +00:00
2024-07-09 05:59:05 +00:00
Route::get('/shop', [MainController::class, 'shop'])->name('shop');
2024-07-04 04:34:45 +00:00
Route::get('/single/{id}', [MainController::class, 'singleProduct']);
Route::get('/register', [MainController::class, 'register'])->name('register');
Route::post('/registerUser', [MainController::class, 'registerUser'])->name('registerUser');
2024-07-04 04:34:45 +00:00
2024-07-09 05:59:05 +00:00
Route::get('/login', [MainController::class, 'login'])->name('login');
2024-07-04 04:34:45 +00:00
Route::post('/loginUser', [MainController::class, 'loginUser']);
2024-07-09 05:59:05 +00:00
Route::get('/logout', [MainController::class, 'logout'])->name('logout');
Route::controller(StripePaymentController::class)->group(function () {
Route::get('stripe', 'stripe');
Route::post('stripe', 'stripePost')->name('stripe.post');
});
2024-07-10 08:01:42 +00:00
// Route::get('/testMail', [MainController::class, 'testMail'])->name('testMail');
Route::get('/testMail', [MainController::class, 'testMail'])->name('testMail');
Route::match(['get', 'post'], '/botman', [BotManController::class, 'handle'])->name('botman');