seller_package.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Affiliate 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\SellerPackageController;
  13. use App\Http\Controllers\SellerSpreadPackageController;
  14. //Admin
  15. Route::group(['prefix' =>'admin', 'middleware' => ['auth', 'admin']], function(){
  16. Route::resource('seller_packages', SellerPackageController::class);
  17. Route::resource('seller_spread_packages', SellerSpreadPackageController::class);
  18. Route::controller(SellerPackageController::class)->group(function () {
  19. Route::get('/seller_packages/edit/{id}', 'edit')->name('seller_packages.edit');
  20. Route::get('/seller_packages/destroy/{id}', 'destroy')->name('seller_packages.destroy');
  21. Route::get('/seller_packages/set_default/{id}', 'set_default')->name('seller_packages.set_default');
  22. });
  23. Route::controller(SellerSpreadPackageController::class)->group(function () {
  24. Route::get('/seller_spread_packages/edit/{id}', 'edit')->name('seller_spread_packages.edit');
  25. Route::get('/seller_spread_packages/destroy/{id}', 'destroy')->name('seller_spread_packages.destroy');
  26. });
  27. });
  28. //FrontEnd
  29. Route::group(['middleware' => ['seller']], function(){
  30. Route::controller(SellerPackageController::class)->group(function () {
  31. Route::get('/seller/seller-packages', 'seller_packages_list')->name('seller.seller_packages_list');
  32. Route::get('/seller/packages-payment-list', 'packages_payment_list')->name('seller.packages_payment_list');
  33. Route::post('/seller_packages/purchase', 'purchase_package')->name('seller_packages.purchase');
  34. Route::post('/seller_packages/buy_package_by_cash', 'buy_package_by_cash')->name('orders.buy_package_cash');
  35. });
  36. });
  37. //FrontEnd
  38. Route::group(['middleware' => ['seller']], function(){
  39. Route::controller(SellerSpreadPackageController::class)->group(function () {
  40. Route::get('/seller/seller-spread-packages', 'seller_spread_packages_list')->name('seller.seller_spread_packages_list');
  41. Route::get('/seller/spread-packages-payment-list', 'spread_packages_payment_list')->name('seller.spread_packages_payment_list');
  42. Route::post('/seller_spread_packages/purchase', 'purchase_spread_package')->name('seller_spread_packages.purchase');
  43. Route::post('/seller_packages/buy_spread_cash', 'buy_spread_cash')->name('orders.buy_spread_cash');
  44. });
  45. });
  46. Route::get('/seller_packages/check_for_invalid', [SellerPackageController::class, 'unpublish_products'])->name('seller_packages.unpublish_products');
  47. Route::get('/seller_spread_packages/check_for_invalid', [SellerSpreadPackageController::class, 'unpublish_products'])->name('seller_spread_packages.unpublish_products');