FleetCart/Modules/Report/SearchReport.php

26 lines
516 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Report;
use Modules\Product\Entities\SearchTerm;
class SearchReport extends Report
{
protected $filters = [];
public function query()
{
return SearchTerm::orderByDesc('hits')
->when(request()->has('keyword'), function ($query) {
$query->where('term', 'LIKE', request('keyword') . '%');
});
}
2023-12-03 14:07:47 +00:00
protected function view()
{
return 'report::admin.reports.search_report.index';
}
2023-06-11 12:14:03 +00:00
}