laravel-datatables icon indicating copy to clipboard operation
laravel-datatables copied to clipboard

Method Illuminate\Http\JsonResponse::toJson does not exist.

Open quantumwebco opened this issue 6 years ago • 5 comments

Laravel 5.7 laravel-datatables 8.0

When using datatables as a service the ajax function gives this error

Cloned the ajax() function into my QuoteDataTable class and replaced return $dataTable->toJson(); with return $dataTable; which seems to have worked.

I tried following all the docs for this but I'm not sure if the docs are wrong or the package is not fully compatible with L5.7?

quantumwebco avatar Jan 24 '19 11:01 quantumwebco

Nah, you might be running into a different issue. Im using Laravel 5.7 and works just fine, why you dont use instead datatable()->eloquent() ?

nikuscs avatar Jan 24 '19 19:01 nikuscs

Tried that but same issue. I'm wondering if it's something to do with the upgrade from 6.0 also upgraded Laravel from 5.4 at same time so it light even be a Laravel thing

quantumwebco avatar Jan 24 '19 20:01 quantumwebco

@igerslike Are you using datatables as a service?

quantumwebco avatar Jan 30 '19 17:01 quantumwebco

Yes, just followed the tutorial and worked just fine. Try doing a clean install of Laravel and check if it works, you probably running into some other issue. @quantumwebco

nikuscs avatar Jan 30 '19 19:01 nikuscs

I get the same issue any solution, The GET method is added in form and in route

SWAT10101 avatar Oct 15 '21 15:10 SWAT10101

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 13 '23 00:06 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Jun 21 '23 00:06 github-actions[bot]