-
Couldn't load subscription status.
- Fork 35
Closed
Labels
needs more infoMore information is requiredMore information is required
Description
- Laravel Version: 12.32.5
- Nova Version: 5.7.5
- PHP Version: 8.4
- Database Driver & Version: MySQL (utf8mb4_unicode_ci collation)
- Operating System and Version: Laravel Vapor / php-8.4:al2-arm
Description:
UTF-8 encoding error occurs when viewing a User resource with HasMany relationship containing Arabic text. Error message: "Malformed UTF-8 characters, possibly incorrectly encoded" in /vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php:89
Individual Email resources display correctly, but the HasMany relationship table fails to render. Database uses utf8mb4_unicode_ci collation, and json_encode(User::with('emails')->find($id)->toArray()) works successfully in direct Laravel tests, which appears to indicate the issue is specific to Nova's HasMany serialization.
Detailed steps to reproduce the issue on a fresh Nova installation:
- Create a MySQL database with utf8mb4_unicode_ci collation
- Create a users table and emails table with user_id foreign key
- Add subject (varchar) and body (mediumtext) fields to emails table with utf8mb4_unicode_ci collation
- Create User and Email models with standard HasMany/BelongsTo relationships
- Create Nova resources for User and Email
- In User Nova resource, add: HasMany::make('Emails')
- Insert email records with Arabic text in subject field
- Visit individual email resource in Nova - works correctly
- Visit user resource in Nova to view HasMany emails relationship - encoding error occurs
- Verify json_encode(User::with('emails')->find($id)->toArray()) works in tinker/artisan command
Metadata
Metadata
Assignees
Labels
needs more infoMore information is requiredMore information is required