mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-03 20:56:21 +00:00
make sure all route binders use guard.
This commit is contained in:
@@ -118,11 +118,11 @@ class Account extends Model
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function routeBinder(string $value): Account
|
||||
public static function routeBinder($guard, string $value): Account
|
||||
{
|
||||
if (auth()->check()) {
|
||||
if ($guard->check()) {
|
||||
$accountId = intval($value);
|
||||
$account = auth()->user()->accounts()->find($accountId);
|
||||
$account = $guard->user()->accounts()->find($accountId);
|
||||
if (!is_null($account)) {
|
||||
return $account;
|
||||
}
|
||||
@@ -290,6 +290,15 @@ class Account extends Model
|
||||
return $journal->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Get all of the notes.
|
||||
*/
|
||||
public function notes()
|
||||
{
|
||||
return $this->morphMany(Note::class, 'noteable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany
|
||||
* @codeCoverageIgnore
|
||||
@@ -345,15 +354,6 @@ class Account extends Model
|
||||
$this->attributes['iban'] = Crypt::encrypt($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Get all of the notes.
|
||||
*/
|
||||
public function notes()
|
||||
{
|
||||
return $this->morphMany(Note::class, 'noteable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user