make sure all route binders use guard.

This commit is contained in:
James Cole
2018-02-07 11:15:36 +01:00
parent eacc1da157
commit 909dc212fb
27 changed files with 86 additions and 84 deletions

View File

@@ -53,11 +53,11 @@ class Rule extends Model
*
* @return Rule
*/
public static function routeBinder(string $value): Rule
public static function routeBinder($guard, string $value): Rule
{
if (auth()->check()) {
if ($guard->check()) {
$ruleId = intval($value);
$rule = auth()->user()->rules()->find($ruleId);
$rule = $guard->user()->rules()->find($ruleId);
if (!is_null($rule)) {
return $rule;
}