diff --git a/src/Models/Ticket.php b/src/Models/Ticket.php index 3426604..8e511b2 100644 --- a/src/Models/Ticket.php +++ b/src/Models/Ticket.php @@ -13,8 +13,22 @@ class Ticket extends Model 'title', 'description', 'status', 'priority_id', 'due_date', 'merged_into_id', ]; + // `date:Y-m-d`, not bare `date`. The column is a DATE and every UI that shows + // it is an , which accepts exactly `Y-m-d` and silently + // renders anything else as an EMPTY field. A bare `date` cast serializes to + // `2026-09-15T00:00:00.000000Z`, so a due date that had been stored perfectly + // well came back as a blank input on the edit form, the show page and the + // index pane — indistinguishable from "it was never saved", which is how this + // was reported (a QA sweep read `input.value === ''` as silent data loss). + // + // The write path was never at fault: the column, the `$fillable` entry and + // both `validate()` rules were correct throughout, and re-submitting the ISO + // string (which Show.vue's meta form does, because it seeds itself from this + // value) still stores the right day — measured in UTC and in + // America/New_York. So nothing was ever lost in the database; the value + // simply had no way of reaching the screen. protected $casts = [ - 'due_date' => 'date', + 'due_date' => 'date:Y-m-d', ]; public function group(): BelongsTo