Bagisto Forum

    Bagisto

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

    Getting exception : Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

    General Discussion
    2
    6
    1021
    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.
    • P
      ppstech last edited by ppstech

      I have created a new datagrid and added a mass update action for it. But after post, it shows 500 error. Grid showing proper data. I want to generate a PDF report for the selected data. This is my code

      Mass action in grid

      $this->addMassAction([
                  'type' => 'View',
                  'label' => trans('marketplace::app.admin.orders.report'),
                  'action' => route('admin.marketplace.sellers.printvendorreport'),
                  'method' => 'PUT'
              ]);
      

      at the address bar , it shows

      public/admin/marketplace/null
      

      This is my route

      Route::put('printvendorreport', 'Webkul\Marketplace\Http\Controllers\Admin\NewSellerController@printvendorreport')->defaults('_config', [
                          'redirect' => 'admin.marketplace.sellers.vendorreport'
                      ])->name('admin.marketplace.sellers.printvendorreport');
      

      I am getting "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException"
      how can I get this working

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        Hi @ppstech

        Change your routes's method to 'post' instead of 'put'.

        Route::post('printvendorreport', 'Webkul\Marketplace\Http\Controllers\Admin\NewSellerController@printvendorreport')->defaults('_config', [
                            'redirect' => 'admin.marketplace.sellers.vendorreport'
                        ])->name('admin.marketplace.sellers.printvendorreport');
        

        Thanks

        1 Reply Last reply Reply Quote 0
        • P
          ppstech last edited by

          Hi @rahul
          I have changed the route, but still the issue is there.

          1 Reply Last reply Reply Quote 0
          • R
            rahul last edited by

            Hi @ppstech

            After changing put to post. Did you run 'php artisan route:cache' ?

            Thanks

            1 Reply Last reply Reply Quote 0
            • P
              ppstech last edited by ppstech

              Hi @rahul ,
              yes, I have run 'php artisan route:cache' command.
              And as I mentioned earlier, it is redirection to 'public/admin/marketplace/null' instead of the mentioned route

              1 Reply Last reply Reply Quote 0
              • R
                rahul last edited by

                Hi @ppstech

                Can you show your controllers code for delete ?

                Thanks

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