/** * {@inheritdoc} */ public function __set($key, $value) { if (array_key_exists($key, $this->aliases)) { $key = $this->aliases[$key]; } parent::__set($key, $value); }
public function __set($key, $value) { $columns = $this->getTableColumns(); if ($this->hasSetMutator($key) || in_array($key, $this->getDates()) && $value || $this->isJsonCastable($key) && !is_null($value) || in_array($key, $columns)) { return parent::__set($key, $value); } $this->setMeta($key, $value); }
/** * Set model's attribute * @param $method (eg 'setId') * @param $d * @return self */ protected function set($method, $d) { $key = $this->match(lcfirst(substr($method, 3))); $this->model->__set($key, $d); return $this; }
/** * Dynamically set attributes. * * @param string $key * @param mixed $value * @return void */ public function __set($key, $value) { // Dynamically set the encryptable attribute if (!empty($value) && $this->setDynamicEncryptable($key, $value)) { return; } // Fallback to the default Eloquent dynamic setter parent::__set($key, $value); // Dynamically juggle the attribute. $this->setDynamicJuggle($key, $value); }
/** * Mustard uses camel case for class properties, and snake case for database columns. * * @param string $property * @param mixed $value */ public function __set($property, $value) { parent::__set(snake_case($property), $value); }