romanzipp / Laravel-Queue-Monitor

Monitoring Laravel Jobs with your Database
https://packagist.org/packages/romanzipp/laravel-queue-monitor
MIT License
698 stars 92 forks source link

Refactors the removed property dates to use the casts property. #111

Closed ordago closed 1 year ago

ordago commented 1 year ago

https://laravel.com/docs/10.x/upgrade#model-dates-property

Laravel 10 removed the $dates property that had deprecated in the previous version. Moving the dates to the casts property maintains the functionality and is backwards compatible.

romanzipp commented 1 year ago

Thanks, didn't spot that. Do you know if there's any minimum version where that datetime cast was introduced?

ordago commented 1 year ago

Hi, I did the change in my codebase during the upgrade to v8.

Not sure about the exact minimum. But as I understand, it should work at least as far back as 5.5:

https://github.com/illuminate/database/blob/97b9f721416560144fb00f02e48d51a45efe2181/Eloquent/Concerns/HasAttributes.php#L43

https://github.com/illuminate/database/blob/97b9f721416560144fb00f02e48d51a45efe2181/Eloquent/Concerns/HasAttributes.php#L462-L490

romanzipp commented 1 year ago

Alright, looks good to me! (Some tests are failing due to database issues, I ran into that error on another repo, should be fine but I'll fix it next week)