*/ use HasFactory; protected $fillable = [ 'transaction_date', 'category', 'amount', 'invoice_number', 'description', ]; protected $casts = [ 'transaction_date' => 'date', 'amount' => 'decimal:2', ]; public function tapActivity(\Spatie\Activitylog\Contracts\Activity $activity, string $eventName) { $activity->properties = $activity->properties->put('snapshot', [ 'transaction_date' => $this->transaction_date->format('Y-m-d'), 'category' => $this->category, 'amount' => $this->amount, 'invoice_number' => $this->invoice_number, ]); } }