auction.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Auction Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register admin routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | contains the "web" middleware group. Now create something great!
  10. |
  11. */
  12. use App\Http\Controllers\AuctionProductController;
  13. use App\Http\Controllers\AuctionProductBidController;
  14. use App\Http\Controllers\CartController;
  15. use App\Http\Controllers\HomeController;
  16. //Admin
  17. Route::group(['prefix' =>'admin', 'middleware' => ['auth', 'admin']], function(){
  18. // Auction product lists
  19. Route::controller(AuctionProductController::class)->group(function () {
  20. Route::get('auction/all-products', 'all_auction_product_list')->name('auction.all_products');
  21. Route::get('auction/inhouse-products', 'inhouse_auction_products')->name('auction.inhouse_products');
  22. Route::get('auction/seller-products', 'seller_auction_products')->name('auction.seller_products');
  23. Route::get('/auction-product/create', 'product_create_admin')->name('auction_product_create.admin');
  24. Route::post('/auction-product/store', 'product_store_admin')->name('auction_product_store.admin');
  25. Route::get('/auction_products/edit/{id}', 'product_edit_admin')->name('auction_product_edit.admin');
  26. Route::post('/auction_products/update/{id}', 'product_update_admin')->name('auction_product_update.admin');
  27. Route::get('/auction_products/destroy/{id}', 'product_destroy_admin')->name('auction_product_destroy.admin');
  28. // Sales
  29. Route::get('/auction_products-orders', 'admin_auction_product_orders')->name('auction_products_orders');
  30. });
  31. Route::controller(AuctionProductBidController::class)->group(function () {
  32. Route::get('/product-bids/{id}', 'product_bids_admin')->name('product_bids.admin');
  33. Route::get('/product-bids/destroy/{id}', 'bid_destroy_admin')->name('product_bids_destroy.admin');
  34. });
  35. });
  36. Route::group(['prefix' => 'seller', 'middleware' => ['seller', 'verified', 'user']], function() {
  37. Route::controller(AuctionProductController::class)->group(function () {
  38. Route::get('/auction_products', 'auction_product_list_seller')->name('auction_products.seller.index');
  39. Route::get('/auction-product/create', 'product_create_seller')->name('auction_product_create.seller');
  40. Route::post('/auction-product/store', 'product_store_seller')->name('auction_product_store.seller');
  41. Route::get('/auction_products/edit/{id}', 'product_edit_seller')->name('auction_product_edit.seller');
  42. Route::post('/auction_products/update/{id}', 'product_update_seller')->name('auction_product_update.seller');
  43. Route::get('/auction_products/destroy/{id}', 'product_destroy_seller')->name('auction_product_destroy.seller');
  44. Route::get('/auction_products-orders', 'seller_auction_product_orders')->name('auction_products_orders.seller');
  45. });
  46. Route::controller(AuctionProductBidController::class)->group(function () {
  47. Route::get('/product-bids/{id}', 'product_bids_seller')->name('product_bids.seller');
  48. Route::get('/product-bids/destroy/{id}', 'bid_destroy_seller')->name('product_bids_destroy.seller');
  49. });
  50. });
  51. Route::group(['middleware' => ['auth']], function() {
  52. Route::resource('auction_product_bids', AuctionProductBidController::class);
  53. Route::post('/auction/cart/show-cart-modal', [CartController::class, 'showCartModalAuction'])->name('auction.cart.showCartModal');
  54. Route::get('/auction/purchase_history', [AuctionProductController::class, 'purchase_history_user'])->name('auction_product.purchase_history');
  55. });
  56. Route::post('/home/section/auction_products', [HomeController::class, 'load_auction_products_section'])->name('home.section.auction_products');
  57. Route::controller(AuctionProductController::class)->group(function () {
  58. Route::get('/auction-product/{slug}', 'auction_product_details')->name('auction-product');
  59. Route::get('/auction-products', 'all_auction_products')->name('auction_products.all');
  60. });