belongsTo('FireflyIII\User'); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function ruleGroup() { return $this->belongsTo('FireflyIII\Models\RuleGroup'); } /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function ruleActions() { return $this->hasMany('FireflyIII\Models\RuleAction'); } /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function ruleTriggers() { 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; } }