Illuminate\Database\Eloquent\Model::hasSetMutator PHP Method

hasSetMutator() public method

Determine if a set mutator exists for an attribute.
public hasSetMutator ( string $key ) : boolean
$key string
return boolean
    public function hasSetMutator($key)
    {
        return method_exists($this, 'set' . Str::studly($key) . 'Attribute');
    }

Usage Example

Example #1
0
 public function hasSetMutator($key)
 {
     if ($this->autohash_attributes) {
         foreach ($this->attributes_schema as $k => $value) {
             if ($value == 'hashed' && $k == $key) {
                 return true;
             }
         }
     }
     if ($this->autoserialize_attributes) {
         foreach ($this->attributes_schema as $k => $value) {
             if ($value == 'array' && $k == $key || $value == 'object' && $k == $key) {
                 return true;
             }
         }
     }
     return parent::hasSetMutator($key);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::hasSetMutator
Model