trypost/app/Models/Traits
Paulo Castellano 54fcaa7263 refactor(media): centralize image/video/document detection in Media\Type
Media-type detection was duplicated across Media, MediaItem (byte-identical copies), HasMedia::getMediaType, the ContentTypeCompatibleWithMedia rule, and six publishers — each hardcoding MIME prefixes and divergent extension lists (Media's video list even had avi/webm/mkv, contradicting the Type enum's mp4/mov).

Add classify(), fromExtension(), and isGif() to Media\Type as the single source for 'what kind is this?' (broad classification), distinct from fromMime()/allowedMimeTypes() (the strict upload allow-list). Every detector now delegates to the enum; the broad extension lists and MIME prefixes live only there. Behavior-preserving (full suite green); adds direct tests for classify/fromExtension/isGif.
2026-06-25 10:57:57 -03:00
..
HasMedia.php refactor(media): centralize image/video/document detection in Media\Type 2026-06-25 10:57:57 -03:00
HasUsage.php refactor(billing): replace MonthlyCreditsLimit Pennant feature with BillingCycle 2026-06-22 09:55:03 -03:00
HasWorkspace.php feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00