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>
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user