Replies: 4 comments 7 replies
-
Based on the knowledge sources provided, there isn't specific information about supporting Backpack has recently added support for PHP Enums (introduced in PHP 8.1) in fields and columns. According to the PHP Enums support pull request, Backpack now supports using fields casted to an For fields, Backpack provides an CRUD::field([
'name' => 'status',
'label' => 'Status',
'type' => 'enum'
]); However, the current implementation doesn't seem to directly support storing multiple enum values in a single attribute or using While it's not exactly what you're asking for, you might be able to achieve something similar using the If you believe this feature would be beneficial, you might consider opening a feature request on the Backpack GitHub repository to discuss its potential implementation with the maintainers. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): Attribute Casting causes error |
Beta Was this translation helpful? Give feedback.
-
@susanu thanks. 🙏 What do you mean multiple enum values? A JSON in the database? If not can you show me a bit more of what you mean ? Cheers |
Beta Was this translation helpful? Give feedback.
-
The data is saved into the database as a json array, when the model is loaded, is transformed into a Collection with enums (the class) SmsScope.php
Model (casts function)
Database
OR
Column
Currently i use the field type |
Beta Was this translation helpful? Give feedback.
-
I've just upgraded to 6.7.48 (from 6.7.43), and I run in to an error with enums. I haven't looked at it any closer now, but it happens when calling the I'll let you know once I find out more. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have one attribute that stores multiple enum values.
Currently there is no field/column that support this.
Do you think is good addition to the current list of fields & columns?
Beta Was this translation helpful? Give feedback.
All reactions