Crud: Getting 405 (Method Not Allowed) when ajax table is enabled

Created on 1 Dec 2016  路  8Comments  路  Source: Laravel-Backpack/CRUD

When I add $this->crud->enableAjaxTable(); to the CRUD controller, the table loads with an error and no data. This is what I see in console:

http://localhost:8000/admin/collection_request/search 405 (Method Not Allowed).

question

Most helpful comment

Oh dear! I have found the issue. I did not set $this->crud->setRoute("admin/collections"); correctly. I need to pay more attention when working.

Thanks @tabacitu and @OwenMelbz

All 8 comments

Hi @sonoftheweb ,

What Laravel & Backpack\CRUD version are you using? It might be that you're using an old version, that didn't have ajax tables and a composer update would fix it.

Cheers!

In composer.json I have this

"backpack/base": "^0.7.0", "backpack/crud": "^3.1.0",

Laravel version is 5.3

@sonoftheweb have you tried running composer update ? As i'd suggest trying out backpack/crud 3.1.45 and backpack/base 0.7.7

@OwenMelbz I have ran composer update several times and cannot seem to get it to work. I'll switch out the version numbers and report back, see if I get something.

@sonoftheweb also can you please type php artisan route:list and copy the results here please :)

@OwenMelbz Sorry I was away for some time. Surprisingly when I do php artisan route:list I get this error:

[ReflectionException] Class App\Http\Controllers\Auth\LoginController does not exist

I also have run composer update. T'is updated to the latest version of backpack and crud.

Just to be sure, this is the error I get on the table:

DataTables warning: table id=crudTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7

@sonoftheweb have you updated Laravel 5.2 to 5.3 recently? If so, you should also upgrade Backpack.

Oh dear! I have found the issue. I did not set $this->crud->setRoute("admin/collections"); correctly. I need to pay more attention when working.

Thanks @tabacitu and @OwenMelbz

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonoftheweb picture sonoftheweb  路  3Comments

jorgepires picture jorgepires  路  3Comments

alexgmin picture alexgmin  路  3Comments

genesiscz picture genesiscz  路  3Comments

bastos71 picture bastos71  路  3Comments