Skip to content

v2.0.0 — Twill 3 + Laravel 11

Choose a tag to compare

@BrunosCode BrunosCode released this 19 Mar 10:57
· 21 commits to main since this release

Twill 2 / Laravel 10 users: stay on the v1.x releases.

Breaking changes

Requirement v1.x v2.0
PHP 8.1+ 8.2+
Laravel 10 11
Twill 2.x 3.x
laravel-translation-handler ^1.0 ^2.0

Twill 3 compatibility

  • All repository and controller methods updated to match Twill 3 contracts: TwillModelContract return type on update, strict signatures on afterSave, filter, getFormFields, indexItemData.
  • Route name prefix is now read from config('twill.admin_route_name_prefix', 'admin.') everywhere — works with both Twill 3's default twill. prefix and custom values.

Bug fixes

  • importGroupCsv ignored the selected CSV delimiter. Uploading a group CSV with , or as delimiter always fell back to ; and failed. The delimiter is now forwarded correctly from the request.
  • Runtime setOption overrides ignored on Laravel 11. Laravel 11's IoC container removed automatic conversion of positional parameters to named ones, causing getCsvHandler() / getPhpHandler() etc. to resolve a fresh TranslationOptions from config instead of using the modified one. Fixed in laravel-translation-handler v2.0.2 (named parameters now used explicitly).

Tests

Rewrote the test infrastructure to be fully compatible with Laravel 11 + SQLite (Twill's default migrations include a cascade migration that fails on SQLite in Laravel 11 — all tables are now defined inline in TestCase).

Added TranslationToolsControllerTest with 14 cases covering:

  • importFromCsv and importGroupCsv with ;, , and delimiters
  • exportToCsv and exportGroupCsv download responses
  • Error paths: mismatched delimiter, missing file, non-existent group

The 404 test for unknown group uses a model-level assertion rather than an HTTP request to avoid Twill attempting to render its error view (which requires compiled assets not present in the test pipeline).

Upgrade from v1.x

composer require brunoscode/twill-translation-handler:^2.0 area17/twill:^3.0 laravel/framework:^11.0
php artisan migrate