data-viewer-laravel-vuejs icon indicating copy to clipboard operation
data-viewer-laravel-vuejs copied to clipboard

No rows returned with default query parameters for Laravel 5.5 or above

Open ashishbatra opened this issue 7 years ago • 2 comments

Issue The api filters will return no rows with default query parameters for your api when used with laravel 5.5 or above.

Fix If you are using latest version of laravel. Please change ($request->has('search_input')) to if($request->filled('search_input')) in line 42 of Helper/Dataviewer.php

Background (Laravel 5.5) The $request->has method will now return true even if the input value is an empty string or null. A new $request->filled method has been added that provides the previous behavior of the has method.

ashishbatra avatar Dec 01 '17 03:12 ashishbatra

@ashishbatra Thanks I lost touch in laravel php, been playing with vue.js for few months.

codekerala avatar Dec 04 '17 05:12 codekerala

@codekerala Nothing to be fixed here. I just added so if someone is facing problem with laravel 5.5 implementation they know it. As the older method will return blank rows.

Also I would like to thank you for the tutorial and the open source code. Its really good. I modified it little bit for my use. I liked the no dependency part and simplicity of it. Must say good work. :)

ashishbatra avatar Dec 05 '17 11:12 ashishbatra