Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Route works only with get

    General Discussion
    2
    2
    110
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      LilD last edited by LilD

      Hi, do you know why I can't fast with these routes and I only go when I get?
      It should be mentioned that I do not have separate pages for them, but there is no separate page for delete either.
      Is it because I gave findOrFail Id?
      Can you give me some advice on what I could do?

      Repository
       public function showPriceWithoutFidelityGroup()
          {
              $user = auth()->guard('customer')->user();
      
              if ( $user->customer_group_id == 6 || $user->customer_group_id == 7  || $user->customer->group_id == 8) {
                  $user->customer_group_id = 1;
                  $user->save();
              }
          }
      
          public function showPriceWithFidelityGroup()
          {
              $user = auth()->guard('customer')->user();
      
              if ( $user->money_spent >= 1000 && $user->money_spent < 5000 ) {
                  $user->customer_group_id = 6;
                  $user->save();
              } else if ($user->money_spent >= 5000 && $user->money_spent < 15000 ) {
                  $user->customer_group_id = 7;
                  $user->save();
              } else if ($user->money_spent >= 15000) {
                  $user->customer_groupd_id = 8;
                  $user->save();
              }
          }
      Controller
       public function showPriceWithoutFidelityGroup()
          {
      
              $this->customerRepository->showPriceWithoutFidelityGroup();
      
              return redirect()->back();;
          }
      
          public function showPriceWithFidelityGroup()
          {
              $this->customerRepository->showPriceWithFidelityGroup();
      
              return redirect()->back();
          }
      Routes
          Route::get('profile/setnofidelity', 'Webkul\Customer\Http\Controllers\CustomerController@showPriceWithoutFidelityGroup')->name('customer.profile.deletegroup');
                      Route::get('profile/setfidelity', 'Webkul\Customer\Http\Controllers\CustomerController@showPriceWithFidelityGroup')->name('customer.profile.setgroup');
      

      And normally here you should update or post.

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        I am not getting this, you have registered your routes as GET so you are getting data only in GET.

        What are you concerned about?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post