pos.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | POS 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\PosController;
  13. Route::controller(PosController::class)->group(function () {
  14. Route::get('/pos/products', 'search')->name('pos.search_product');
  15. Route::post('/add-to-cart-pos', 'addToCart')->name('pos.addToCart');
  16. Route::post('/update-quantity-cart-pos', 'updateQuantity')->name('pos.updateQuantity');
  17. Route::post('/remove-from-cart-pos', 'removeFromCart')->name('pos.removeFromCart');
  18. Route::post('/get_shipping_address', 'getShippingAddress')->name('pos.getShippingAddress');
  19. Route::post('/get_shipping_address_seller', 'getShippingAddressForSeller')->name('pos.getShippingAddressForSeller');
  20. Route::post('/setDiscount', 'setDiscount')->name('pos.setDiscount');
  21. Route::post('/setShipping', 'setShipping')->name('pos.setShipping');
  22. Route::post('/set-shipping-address', 'set_shipping_address')->name('pos.set-shipping-address');
  23. Route::post('/pos-order-summary', 'get_order_summary')->name('pos.getOrderSummary');
  24. Route::post('/pos-order', 'order_store')->name('pos.order_place');
  25. });
  26. //Admin
  27. Route::group(['prefix' =>'admin', 'middleware' => ['auth', 'admin']], function(){
  28. //pos
  29. Route::controller(PosController::class)->group(function () {
  30. Route::get('/pos', 'index')->name('poin-of-sales.index');
  31. Route::get('/pos-activation', 'pos_activation')->name('poin-of-sales.activation');
  32. });
  33. });
  34. //Seller
  35. Route::group(['prefix' =>'seller', 'middleware' => ['seller', 'verified']], function(){
  36. //pos
  37. Route::get('/pos', [PosController::class, 'index'])->name('poin-of-sales.seller_index');
  38. });
  39. //salesman
  40. Route::group(['prefix' =>'salesman', 'middleware' => ['auth', 'salesman']], function(){
  41. //pos
  42. Route::controller(PosController::class)->group(function () {
  43. Route::get('/pos', 'index')->name('salesman.poin-of-sales.index');
  44. Route::get('/pos-activation', 'pos_activation')->name('salesman.poin-of-sales.activation');
  45. });
  46. });