mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Refactor models.
This commit is contained in:
@@ -84,6 +84,22 @@ class AvailableBudget extends Model
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
'amount' => 'string',
|
||||
'native_amount' => 'string',
|
||||
'user_id' => 'integer',
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected function endDate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
@@ -106,20 +122,4 @@ class AvailableBudget extends Model
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
'amount' => 'string',
|
||||
'native_amount' => 'string',
|
||||
'user_id' => 'integer',
|
||||
'user_group_id' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user