mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-04-20 23:41:52 +02:00
Use query method rather than querying where 1 = 1
This commit is contained in:
parent
c5ae146683
commit
ebc6525b65
@ -32,7 +32,7 @@ class ComponentController extends AbstractApiController
|
||||
public function getComponents()
|
||||
{
|
||||
if (app(Guard::class)->check()) {
|
||||
$components = Component::whereRaw('1 = 1');
|
||||
$components = Component::query();
|
||||
} else {
|
||||
$components = Component::enabled();
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class ComponentGroupController extends AbstractApiController
|
||||
*/
|
||||
public function getGroups()
|
||||
{
|
||||
$groups = ComponentGroup::whereRaw('1=1');
|
||||
$groups = ComponentGroup::query();
|
||||
|
||||
$groups->search(Binput::except(['sort', 'order', 'per_page']));
|
||||
|
||||
|
@ -29,7 +29,7 @@ class MetricController extends AbstractApiController
|
||||
*/
|
||||
public function getMetrics()
|
||||
{
|
||||
$metrics = Metric::whereRaw('1=1');
|
||||
$metrics = Metric::query();
|
||||
|
||||
if ($sortBy = Binput::get('sort')) {
|
||||
$direction = Binput::has('order') && Binput::get('order') == 'desc';
|
||||
|
Loading…
x
Reference in New Issue
Block a user