public function fill(array $input, bool $force = false)
    {
        foreach ($input as $key => $value) {
            if ($force) {
                $this->setAttribute($key, $value);

                continue;
            }

            if ((empty($this->fillable) || in_array($key, $this->fillable)) && !in_array($key, $this->guarded)) {
                $this->setAttribute($key, $value);
            }
        }
    }
public function fill(array $input, bool $force = false)
    {
        foreach ($input as $key => $value) {
            if ($force) {
                $this->setAttribute($key, $value);

                continue;
            }

            if ((empty($this->fillable) || in_array($key, $this->fillable)) && !in_array($key, $this->guarded)) {
                $this->setAttribute($key, $value);
            }
        }
    }
public function fill ( array $ input , bool $ force = false ) { foreach ( $ input as $ key => $ value ) { if ( $ force ) { $ this -> setAttribute ( $ key , $ value ) ; continue ; } if ( ( empty ( $ this -> fillable ) || in_array ( $ key , $ this -> fillable ) ) && ! in_array ( $ key , $ this -> guarded ) ) { $ this -> setAttribute ( $ key , $ value ) ; } } }
Set the model attributes using an array.

@param array $input the data that will be used to fill the attributes
@param bool  $force force fill
Set the model attributes using an array .