Skip to content

Conversation

@solv1k
Copy link

@solv1k solv1k commented Nov 4, 2025

Исправлено склонение:
image

@php
$count = \App\Models\Package::approved()->where('type', $type)->count();
$forms = ['пакет', 'пакета', 'пакетов'];
$form = $forms[($count % 100 > 4 && $count % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][min($count % 10, 5)]];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Разве не достаточно будет указать явно диапазон:

{{ trans_choice('{1} :count пакет|[2,4] :count пакета|[5,*] :count пакетов', \App\Models\Package::approved()->where('type', $type)->count()) }}

Copy link
Author

@solv1k solv1k Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет. Сначала я именно так и сделал. Но, как оказалось - нет)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants