skip type scope in dashboard and reports

This commit is contained in:
Denis Duliçi 2020-12-29 18:18:53 +03:00
parent 825b43d32c
commit cd070261fc

View File

@ -71,7 +71,15 @@ trait Scopes
public function getTypeFromRequest()
{
$type = request()->get('type') ?: Str::singular((string) request()->segment(2));
$type = '';
$request = request();
// Skip type scope in dashboard and reports
if ($request->routeIs('dashboards.*') || $request->routeIs('reports.*')) {
return $type;
}
$type = $request->get('type') ?: Str::singular((string) $request->segment(2));
if ($type == 'revenue') {
$type = 'income';