0

I want to get the SQL and search conditions built on the search screen of laravel-admin to register in the DB. Because I can search under the same conditions.

My question is "how to get search conditions like 'scheduled_date' at search result" grid code is below. I want to get search conditions at controller. Laravel version 6.18.3 laravel-admin 1.7 PHP 7.3.11

protected function grid($request)
{
$grid = new Grid(new Sms);
$grid->column('customer_id', ('customer')); $grid->column('scheduled_date', ('SCHEDULED_DATE'))->sortable();

$grid->expandFilter();
$grid->filter(function($filter){
$filter->disableIdFilter();

$filter->between('scheduled_date', SCHEDULED_DATE)->date(300);

});

return $grid;
}

please help!

syun-03
  • 1
  • 2
  • Could you elaborate what the problem is? Does this code not work? Do you have an example of what you want to achieve? Maybe you can show us what result you get now? – Techno Apr 13 '20 at 16:47
  • the code is work.i want to get search conditions like 'scheduled_date' at somewhere controller – syun-03 Apr 14 '20 at 07:51

1 Answers1

0

You can use $request()-><query_string_name>

For example, if the URL is: http://localhost:8000/post?id=1&author=foo you can get id and author with $request()->id and $request()->author.

Victor
  • 995
  • 1
  • 10
  • 26