mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 19:09:50 +00:00
🤖 Auto commit for release 'develop' on 2025-09-15
This commit is contained in:
@@ -28,6 +28,7 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use function Safe\json_decode;
|
||||
use function Safe\json_encode;
|
||||
|
||||
@@ -38,7 +39,7 @@ class TransactionJournalMeta extends Model
|
||||
|
||||
protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash'];
|
||||
|
||||
protected $table = 'journal_meta';
|
||||
protected $table = 'journal_meta';
|
||||
|
||||
public function transactionJournal(): BelongsTo
|
||||
{
|
||||
@@ -56,7 +57,7 @@ class TransactionJournalMeta extends Model
|
||||
|
||||
protected function data(): Attribute
|
||||
{
|
||||
return Attribute::make(get: fn($value) => json_decode((string)$value, false), set: function ($value) {
|
||||
return Attribute::make(get: fn ($value) => json_decode((string)$value, false), set: function ($value) {
|
||||
$data = json_encode($value);
|
||||
|
||||
return ['data' => $data, 'hash' => hash('sha256', $data)];
|
||||
@@ -66,7 +67,7 @@ class TransactionJournalMeta extends Model
|
||||
protected function transactionJournalId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
get: static fn ($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user