Skip to content

Conversation

themsaid
Copy link
Member

This allows casting Eloquent model attributes to enums:

public $casts = [
    'status' => ServerStatus::class,
];

Then people can do:

if ($server->status == ServerStatus::provisioned){
    // ...
}

@ankurk91
Copy link
Contributor

Note :

This feature requires php 8.1

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.

6 participants