Skip to content

Commit

Permalink
Stop making DB queries on console mode (#356)
Browse files Browse the repository at this point in the history
* Stop making DB queries on console mode

* using === true on condition
  • Loading branch information
Mehedi Hassan authored and nWidart committed Jul 25, 2017
1 parent e8bd9af commit 368a2b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Providers/MenuServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ private function hasChildren($item)
*/
private function registerMenus()
{
if ($this->app['asgard.isInstalled'] === false || $this->app['asgard.onBackend'] === true) {
if ($this->app['asgard.isInstalled'] === false ||
$this->app['asgard.onBackend'] === true ||
$this->app->runningInConsole() === true
) {
return;
}

$menu = $this->app->make(MenuRepository::class);
$menuItem = $this->app->make(MenuItemRepository::class);
foreach ($menu->allOnline() as $menu) {
Expand Down

0 comments on commit 368a2b1

Please sign in to comment.