kodeine / laravel-meta

Fluent Meta Data for Eloquent Models, as if it is a property on your model
MIT License
398 stars 89 forks source link

setMeta() doesn't remove if set default value #70

Closed thewebartisan7 closed 2 years ago

thewebartisan7 commented 4 years ago

I notice that setMeta() doesn't remove record if we set default value.

    public $defaultMetaValues = [
        'about'         => 'default'
    ];

    $tester->about = 'default';
    $tester->save(); // remove record from database

    $tester->setMeta('about', 'default')->save();  // doesn't remove

I see that the check if is default value is only in __set() method, but not in setMeta(), this:

https://github.com/kodeine/laravel-meta/blob/master/src/Kodeine/Metable/Metable.php#L383-L391

So it's not an issue, I would like to know why this behaviour?

Thanks for this simple but powerful package!