Files
autocrm/app/Support/I18n.php
T
Vasyka 8cf14b7e00 fix: add missing App\Support\I18n class
Was created but never staged in the previous commit; deployment failed
with 'Class App\Support\I18n not found' on any page that uses the
I18n::opts() wrapper on Model::CONSTANT Select options.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-16 06:54:28 +00:00

16 lines
337 B
PHP

<?php
namespace App\Support;
class I18n
{
/**
* Translate the string values of an options array (key stays as DB enum).
* Usage: ->options(I18n::opts(Model::STATUSES))
*/
public static function opts(array $options): array
{
return array_map(fn ($v) => is_string($v) ? __($v) : $v, $options);
}
}