formatting

This commit is contained in:
Denis Duliçi 2020-12-26 21:06:12 +03:00
parent 92eaf16693
commit 756ee6b5ee

View File

@ -22,10 +22,8 @@ trait Scopes
return; return;
} }
$type = request()->get('type') ?: $this->getTypeFromUrl();
// Apply type scope // Apply type scope
$builder->where($model->getTable() . '.type', '=', $type); $builder->where($model->getTable() . '.type', '=', $this->getTypeFromRequest());
} }
/** /**
@ -60,9 +58,9 @@ trait Scopes
return false; return false;
} }
public function getTypeFromUrl() public function getTypeFromRequest()
{ {
$type = Str::singular(request()->segment(2, '')); $type = request()->get('type') ?: Str::singular(request()->segment(2, ''));
if ($type == 'revenue') { if ($type == 'revenue') {
$type = 'income'; $type = 'income';