Display an Incident and Component count in the sidebar.
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user