Skip to content

Commit

Permalink
don't try to show suggestions in console #356
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 28, 2018
1 parent fa0cd66 commit df281ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 8 additions & 3 deletions app/Http/ViewComposers/Suggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class Suggestions
*/
public function compose(View $view)
{
$suggestion_module = false;
// No need to add suggestions in console
if (app()->runningInConsole()) {
return;
}

$modules = false;

$path = Route::current()->uri();

Expand All @@ -40,11 +45,11 @@ public function compose(View $view)
if ($suggestion_modules) {
shuffle($suggestion_modules);

$suggestion_module[] = $suggestion_modules[0];
$modules[] = $suggestion_modules[0];
}
}
}

$view->with(['suggestion_modules' => $suggestion_module]);
$view->with(['suggestion_modules' => $modules]);
}
}
8 changes: 2 additions & 6 deletions resources/views/partials/admin/content.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
@yield('title')
@yield('new_button')
@if ($suggestion_modules)
@foreach($suggestion_modules as $suggestion_module)
@foreach($suggestion_modules as $s_module)
<span class="new-button">
@if(strpos($suggestion_module->action_url,'https://akaunting.com/apps') !== false)
<a href="{{ url($suggestion_module->action_url) }}" target="_blank" class="btn btn-default btn-sm"><span class="fa fa-rocket"></span> &nbsp;{{ $suggestion_module->name }}</a>
@else
<a href="{{ url($suggestion_module->action_url) }}" class="btn btn-default btn-sm"><span class="fa fa-rocket"></span> &nbsp;{{ $suggestion_module->name }}</a>
@endif
<a href="{{ url($s_module->action_url) }}" class="btn btn-default btn-sm" target="{{ url($s_module->action_target) }}"><span class="fa fa-rocket"></span> &nbsp;{{ $s_module->name }}</a>
</span>
@endforeach
@endif
Expand Down

0 comments on commit df281ce

Please sign in to comment.