Refactor validator stuff and fix variable names in views
This commit is contained in:
@@ -14,7 +14,7 @@ namespace CachetHQ\Cachet\Composers;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoggedUserComposer
|
||||
class CurrentUserComposer
|
||||
{
|
||||
/**
|
||||
* Bind data to the view.
|
||||
@@ -23,6 +23,6 @@ class LoggedUserComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->with('loggedUser', Auth::user());
|
||||
$view->withCurrentUser(Auth::user());
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class DashboardComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->with('incidentCount', Incident::notScheduled()->count());
|
||||
$view->with('componentCount', Component::all()->count());
|
||||
$view->withIncidentCount(Incident::notScheduled()->count());
|
||||
$view->withComponentCount(Component::all()->count());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ class ThemeComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->with('themeBackgroundColor', Setting::get('style_background_color'));
|
||||
$view->with('themeTextColor', Setting::get('style_text_color'));
|
||||
$view->withThemeBackgroundColor(Setting::get('style_background_color'));
|
||||
$view->withThemeTextColor(Setting::get('style_text_color'));
|
||||
|
||||
$viewData = $view->getData();
|
||||
$themeView = array_only($viewData, preg_grep('/^theme/', array_keys($viewData)));
|
||||
@@ -32,6 +32,6 @@ class ThemeComposer
|
||||
return $data != null;
|
||||
});
|
||||
|
||||
$view->with('themeSetup', !empty($hasThemeSettings));
|
||||
$view->withThemeSetup(!empty($hasThemeSettings));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,9 +65,7 @@ class TimezoneLocaleComposer
|
||||
}
|
||||
}
|
||||
|
||||
$view->with([
|
||||
'timezones' => $timezones,
|
||||
'langs' => $langs,
|
||||
]);
|
||||
$view->withTimezones($timezones);
|
||||
$view->withLangs($langs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user