Skip to content

Conversation

osbre
Copy link
Contributor

@osbre osbre commented Mar 28, 2023

Example:

protected $casts = [
    'elements' => AsCollection::class.':'.ElementCollection::class,
    // or
    'elements' => AsEncryptedCollection::class.':'.ElementCollection::class,
];

(In a similar way to AsEnumCollection)

protected $casts = [
    'statuses' => AsEnumCollection::class.':'.ServerStatus::class,
];

@osbre osbre changed the title [10.x] Add ability to set a custom collection class for the AsCollection cast [10.x] Add ability to set a custom collection class for the AsCollection and AsEncryptedCollection casts Mar 28, 2023
@osbre osbre changed the title [10.x] Add ability to set a custom collection class for the AsCollection and AsEncryptedCollection casts [10.x] Add ability to set a custom class for the AsCollection and AsEncryptedCollection casts Mar 28, 2023
@taylorotwell taylorotwell merged commit 5c9656e into laravel:10.x Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants