mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
make sure all route binders use guard.
This commit is contained in:
@@ -88,11 +88,11 @@ class Budget extends Model
|
||||
*
|
||||
* @return Budget
|
||||
*/
|
||||
public static function routeBinder(string $value): Budget
|
||||
public static function routeBinder($guard, string $value): Budget
|
||||
{
|
||||
if (auth()->check()) {
|
||||
if ($guard->check()) {
|
||||
$budgetId = intval($value);
|
||||
$budget = auth()->user()->budgets()->find($budgetId);
|
||||
$budget = $guard->user()->budgets()->find($budgetId);
|
||||
if (!is_null($budget)) {
|
||||
return $budget;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user