mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Re-order rule groups.
This commit is contained in:
@@ -184,8 +184,8 @@ class RuleController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$ruleGroups = Auth::user()->ruleGroups()->with(['rules' => function($query) {
|
||||
$query->orderBy('order','ASC');
|
||||
$ruleGroups = Auth::user()->ruleGroups()->orderBy('order','ASC') ->with(['rules' => function ($query) {
|
||||
$query->orderBy('order', 'ASC');
|
||||
|
||||
}])->get();
|
||||
|
||||
@@ -219,4 +219,30 @@ class RuleController extends Controller
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RuleRepositoryInterface $repository
|
||||
* @param RuleGroup $ruleGroup
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function upRuleGroup(RuleRepositoryInterface $repository, RuleGroup $ruleGroup)
|
||||
{
|
||||
$repository->moveRuleGroupUp($ruleGroup);
|
||||
|
||||
return redirect(route('rules.index'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RuleRepositoryInterface $repository
|
||||
* @param RuleGroup $ruleGroup
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function downRuleGroup(RuleRepositoryInterface $repository, RuleGroup $ruleGroup)
|
||||
{
|
||||
$repository->moveRuleGroupDown($ruleGroup);
|
||||
|
||||
return redirect(route('rules.index'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user