From fc2e84422853fd7c46c1381bbb5f632f9feea5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Sun, 27 Dec 2020 02:19:50 +0300 Subject: [PATCH] skip type scope in console --- app/Traits/Scopes.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Traits/Scopes.php b/app/Traits/Scopes.php index 3eee9ec9c..a382ae811 100644 --- a/app/Traits/Scopes.php +++ b/app/Traits/Scopes.php @@ -22,6 +22,11 @@ trait Scopes return; } + // No request in console + if (app()->runningInConsole()) { + return; + } + // Apply type scope $builder->where($model->getTable() . '.type', '=', $this->getTypeFromRequest()); }