• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

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

General Discussion
2
6
1.0k
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 27 Aug 2019, 11:09 27 Aug 2019, 09:24

    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 27 Aug 2019, 15:00

      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 28 Aug 2019, 06:16

        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 28 Aug 2019, 06:19

          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 28 Aug 2019, 06:36 28 Aug 2019, 06:29

            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 29 Aug 2019, 11:10

              Hi @ppstech

              Can you show your controllers code for delete ?

              Thanks

              1 Reply Last reply Reply Quote 0
              5 out of 6
              • First post
                5/6
                Last post