mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 14:58:40 +00:00
Mild code cleanup.
This commit is contained in:
@@ -14,7 +14,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
class AccountBalance extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = ['account_id', 'title', 'transaction_currency_id', 'balance','date','date_tz'];
|
||||
protected $fillable = ['account_id', 'title', 'transaction_currency_id', 'balance', 'date', 'date_tz'];
|
||||
|
||||
public function account(): BelongsTo
|
||||
{
|
||||
|
@@ -51,7 +51,7 @@ class AvailableBudget extends Model
|
||||
'transaction_currency_id' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz','end_date_tz'];
|
||||
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
@@ -54,7 +54,7 @@ class BudgetLimit extends Model
|
||||
'deleted' => Deleted::class,
|
||||
];
|
||||
|
||||
protected $fillable = ['budget_id', 'start_date', 'end_date','start_date_tz','end_date_tz', 'amount', 'transaction_currency_id'];
|
||||
protected $fillable = ['budget_id', 'start_date', 'end_date', 'start_date_tz', 'end_date_tz', 'amount', 'transaction_currency_id'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
@@ -49,7 +49,7 @@ class CurrencyExchangeRate extends Model
|
||||
'to_currency_id' => 'int',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date','date_tz', 'rate'];
|
||||
protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date', 'date_tz', 'rate'];
|
||||
|
||||
public function fromCurrency(): BelongsTo
|
||||
{
|
||||
|
@@ -44,7 +44,7 @@ class InvitedUser extends Model
|
||||
'expires' => 'datetime',
|
||||
'redeemed' => 'boolean',
|
||||
];
|
||||
protected $fillable = ['user_id', 'email', 'invite_code', 'expires','expires_tz', 'redeemed'];
|
||||
protected $fillable = ['user_id', 'email', 'invite_code', 'expires', 'expires_tz', 'redeemed'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
@@ -53,7 +53,7 @@ class PiggyBank extends Model
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate','startdate_tz', 'targetdate', 'targetdate_tz', 'active'];
|
||||
protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate', 'startdate_tz', 'targetdate', 'targetdate_tz', 'active'];
|
||||
|
||||
protected $hidden = ['targetamount_encrypted', 'encrypted'];
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class PiggyBankEvent extends Model
|
||||
'date' => 'date',
|
||||
];
|
||||
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'date_tz','amount'];
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'date_tz', 'amount'];
|
||||
|
||||
protected $hidden = ['amount_encrypted'];
|
||||
|
||||
|
@@ -45,7 +45,7 @@ class PiggyBankRepetition extends Model
|
||||
'targetdate' => 'date',
|
||||
];
|
||||
|
||||
protected $fillable = ['piggy_bank_id', 'startdate','startdate_tz', 'targetdate','targetdate_tz', 'currentamount'];
|
||||
protected $fillable = ['piggy_bank_id', 'startdate', 'startdate_tz', 'targetdate', 'targetdate_tz', 'currentamount'];
|
||||
|
||||
public function piggyBank(): BelongsTo
|
||||
{
|
||||
|
@@ -60,7 +60,7 @@ class Recurrence extends Model
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date','first_date_tz', 'repeat_until','repeat_until_tz', 'latest_date','latest_date_tz', 'repetitions', 'apply_rules', 'active'];
|
||||
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date', 'first_date_tz', 'repeat_until', 'repeat_until_tz', 'latest_date', 'latest_date_tz', 'repetitions', 'apply_rules', 'active'];
|
||||
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'recurrences';
|
||||
|
@@ -53,7 +53,7 @@ class Tag extends Model
|
||||
'longitude' => 'float',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'tag', 'date','date_tz', 'description', 'tagMode'];
|
||||
protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'date_tz', 'description', 'tagMode'];
|
||||
|
||||
protected $hidden = ['zoomLevel', 'latitude', 'longitude'];
|
||||
|
||||
|
@@ -109,6 +109,7 @@ class IsUniqueAccount implements ValidationRule, DataAwareRule
|
||||
{
|
||||
if (!array_key_exists('user_id', $this->data)) {
|
||||
$this->fail('No user ID provided.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user