- Lunar version: 1.0.0-beta.6
- Laravel Version: 11.35.1
- PHP Version: 8.3.15
- Database Driver & Version: MySQL 8
Expected Behaviour:
When creating a custom attribute file field type by following the documentation, the file should be correctly saved, and its reference should be stored in the database.
Actual Behaviour:
When attempting to save a custom attribute file field type, an error occurs. The issue seems to stem from the AttributeData class, specifically in the ->mutateDehydratedStateUsing method. There is an if condition that checks:
if ($attribute->type == FileFieldType::class)
Since a custom attribute file field type is not strictly equal to FileFieldType::class, this condition does not execute.
Steps To Reproduce:
- Follow the Lunar documentation to create a custom attribute field type for a file upload.
- Attempt to save a record with this custom file field type.
- Observe that an error occurs because the if condition does not account for custom file field types.