'boolean', 'updated_by' => 'integer', 'updated_at' => 'datetime', ]; /** * Fetch an active template by code and variant, falling back to default. */ public function getTemplate(string $code, string $variant = 'default'): ?array { $row = self::query() ->where('code', $code) ->where('variant', $variant) ->where('is_active', true) ->first(); if ($row) { return $row->toArray(); } $row = self::query() ->where('code', $code) ->where('variant', 'default') ->where('is_active', true) ->first(); return $row ? $row->toArray() : null; } }