Skip to content

Add cast to Model class[Feature Request]  #2199

Closed
@mhbesharatnia

Description

@mhbesharatnia

Hello!
I hope to be fine!
As I understand, there is not casting support in the models (according to some Issue like this #1580 )
I present to add this function to the model:

public function setAttribute($key, $value)
{
    if ($this->hasCast($key)) {
        $value = $this->castAttribute($key, $value);
    }
    return parent::setAttribute($key, $value);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs investigationNeed investigation about bugs described in issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions