mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Prep stuff for routes and actions.
This commit is contained in:
parent
768508dd4b
commit
5ac88623ed
@ -11,6 +11,7 @@ namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Http\Requests;
|
||||
use FireflyIII\Models\Rule;
|
||||
use View;
|
||||
|
||||
/**
|
||||
@ -40,4 +41,12 @@ class RuleController extends Controller
|
||||
|
||||
return view('rules.index', compact('ruleGroups'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*/
|
||||
public function upRule(Rule $rule)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Auth;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Class Rule
|
||||
@ -66,4 +67,19 @@ class Rule extends Model
|
||||
return $this->hasMany('FireflyIII\Models\RuleTrigger');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule $value
|
||||
*
|
||||
* @return Rule
|
||||
*/
|
||||
public static function routeBinder(Rule $value)
|
||||
{
|
||||
if (Auth::check()) {
|
||||
if ($value->user_id == Auth::user()->id) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -158,6 +158,8 @@ return [
|
||||
'piggyBank' => 'FireflyIII\Models\PiggyBank',
|
||||
'tj' => 'FireflyIII\Models\TransactionJournal',
|
||||
'tag' => 'FireflyIII\Models\Tag',
|
||||
'rule' => 'FireflyIII\Models\Rule',
|
||||
'ruleGroup' => 'FireflyIII\Models\RuleGroup',
|
||||
// lists
|
||||
'accountList' => 'FireflyIII\Support\Binder\AccountList',
|
||||
'budgetList' => 'FireflyIII\Support\Binder\BudgetList',
|
||||
|
Loading…
Reference in New Issue
Block a user