v2.0.0 — Twill 3 + Laravel 11
Twill 2 / Laravel 10 users: stay on the
v1.xreleases.
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:
TwillModelContractreturn type onupdate, strict signatures onafterSave,filter,getFormFields,indexItemData. - Route name prefix is now read from
config('twill.admin_route_name_prefix', 'admin.')everywhere — works with both Twill 3's defaulttwill.prefix and custom values.
Bug fixes
importGroupCsvignored 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
setOptionoverrides ignored on Laravel 11. Laravel 11's IoC container removed automatic conversion of positional parameters to named ones, causinggetCsvHandler()/getPhpHandler()etc. to resolve a freshTranslationOptionsfrom config instead of using the modified one. Fixed inlaravel-translation-handlerv2.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:
importFromCsvandimportGroupCsvwith;,,and⇥delimitersexportToCsvandexportGroupCsvdownload 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