mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove reference to guard from models.
This commit is contained in:
parent
14772469ed
commit
53a6c10ada
@ -118,11 +118,11 @@ class Account extends Model
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Account
|
||||
public static function routeBinder(string $value): Account
|
||||
{
|
||||
if ($guard->check()) {
|
||||
if (auth()->check()) {
|
||||
$accountId = intval($value);
|
||||
$account = $guard->user()->accounts()->find($accountId);
|
||||
$account = auth()->user()->accounts()->find($accountId);
|
||||
if (!is_null($account)) {
|
||||
return $account;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class Attachment extends Model
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Attachment
|
||||
public static function routeBinder(string $value): Attachment
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$attachmentId = intval($value);
|
||||
|
@ -73,11 +73,11 @@ class Bill extends Model
|
||||
*
|
||||
* @return Bill
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Bill
|
||||
public static function routeBinder(string $value): Bill
|
||||
{
|
||||
if ($guard->check()) {
|
||||
if (auth()->check()) {
|
||||
$billId = intval($value);
|
||||
$bill = $guard->user()->bills()->find($billId);
|
||||
$bill = auth()->user()->bills()->find($billId);
|
||||
if (!is_null($bill)) {
|
||||
return $bill;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class Budget extends Model
|
||||
*
|
||||
* @return Budget
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Budget
|
||||
public static function routeBinder(string $value): Budget
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$budgetId = intval($value);
|
||||
|
@ -49,7 +49,7 @@ class BudgetLimit extends Model
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): BudgetLimit
|
||||
public static function routeBinder(string $value): BudgetLimit
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$budgetLimitId = intval($value);
|
||||
|
@ -87,7 +87,7 @@ class Category extends Model
|
||||
*
|
||||
* @return Category
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Category
|
||||
public static function routeBinder(string $value): Category
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$categoryId = intval($value);
|
||||
|
@ -48,7 +48,7 @@ class ExportJob extends Model
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): ExportJob
|
||||
public static function routeBinder(string $value): ExportJob
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$key = trim($value);
|
||||
|
@ -65,7 +65,7 @@ class ImportJob extends Model
|
||||
* @throws NotFoundHttpException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): ImportJob
|
||||
public static function routeBinder(string $value): ImportJob
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$key = trim($value);
|
||||
|
@ -54,7 +54,7 @@ class LinkType extends Model
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): LinkType
|
||||
public static function routeBinder(string $value): LinkType
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$linkTypeId = intval($value);
|
||||
|
@ -65,7 +65,7 @@ class PiggyBank extends Model
|
||||
*
|
||||
* @return PiggyBank
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): PiggyBank
|
||||
public static function routeBinder(string $value): PiggyBank
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$piggyBankId = intval($value);
|
||||
|
@ -53,7 +53,7 @@ class Rule extends Model
|
||||
*
|
||||
* @return Rule
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Rule
|
||||
public static function routeBinder(string $value): Rule
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$ruleId = intval($value);
|
||||
|
@ -56,7 +56,7 @@ class RuleGroup extends Model
|
||||
*
|
||||
* @return RuleGroup
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): RuleGroup
|
||||
public static function routeBinder(string $value): RuleGroup
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$ruleGroupId = intval($value);
|
||||
|
@ -91,7 +91,7 @@ class Tag extends Model
|
||||
*
|
||||
* @return Tag
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): Tag
|
||||
public static function routeBinder(string $value): Tag
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$tagId = intval($value);
|
||||
|
@ -58,7 +58,7 @@ class TransactionCurrency extends Model
|
||||
*
|
||||
* @return TransactionCurrency
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): TransactionCurrency
|
||||
public static function routeBinder(string $value): TransactionCurrency
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$currencyId = intval($value);
|
||||
|
@ -86,7 +86,7 @@ class TransactionJournal extends Model
|
||||
*
|
||||
* @return TransactionJournal
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): TransactionJournal
|
||||
public static function routeBinder(string $value): TransactionJournal
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$journalId = intval($value);
|
||||
|
@ -44,7 +44,7 @@ class TransactionJournalLink extends Model
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder($guard, string $value): TransactionJournalLink
|
||||
public static function routeBinder(string $value): TransactionJournalLink
|
||||
{
|
||||
if ($guard->check()) {
|
||||
$linkId = intval($value);
|
||||
|
@ -72,7 +72,7 @@ class TransactionType extends Model
|
||||
*
|
||||
* @return Model|null|static
|
||||
*/
|
||||
public static function routeBinder($guard, string $type): TransactionType
|
||||
public static function routeBinder(string $type): TransactionType
|
||||
{
|
||||
if (!$guard->check()) {
|
||||
throw new NotFoundHttpException();
|
||||
|
Loading…
Reference in New Issue
Block a user