Display an Incident and Component count in the sidebar.

This commit is contained in:
James Brooks
2015-03-05 19:53:32 +00:00
parent 9db90c1b81
commit b1746d1b9e
6 changed files with 39 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace CachetHQ\Cachet\Composers;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\Component;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;
class DashboardComposer
{
/**
* Bind data to the view.
*
* @param \Illuminate\View\View $view
*
* @return void
*/
public function compose(View $view)
{
$view->with('incidentCount', Incident::notScheduled()->count());
$view->with('componentCount', Component::all()->count());
}
}
@@ -25,6 +25,7 @@ class ViewComposerServiceProvider extends ServiceProvider
{
$this->app->view->composer('*', 'CachetHQ\Cachet\Composers\LoggedUserComposer');
$this->app->view->composer('index', 'CachetHQ\Cachet\Composers\IndexComposer');
$this->app->view->composer('dashboard.*', 'CachetHQ\Cachet\Composers\DashboardComposer');
$this->app->view->composer([
'setup',
'dashboard.settings.app-setup',