Add cast to Model class[Feature Request]
Hello! I hope to be fine! As I understand, there is not casting support in the models (according to some Issue like this https://github.com/jenssegers/laravel-mongodb/issues/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);
}
Hello,
As I understand, there is not casting support in the models (according to some Issue like this #1580 )
This is an old issue tagged as fixed. How you check it yourself?
Thanks!
Hello,
As I understand, there is not casting support in the models (according to some Issue like this #1580 )
This is an old issue tagged as fixed. How you check it yourself?
Thanks!
It is not fixed for everyone I suggest to add this to fix it in Model layer I used v3.8.2 in this version also if you wand cast property in class that extended from this library Model you should add setAttribute function to class for casting. If this function added to Model every one can use cast without writing more codes.