Make an instance of the model with the given attributes.

@param  array  $attributes
@return \Illuminate\Database\Eloquent\Model
762625
protected function makeInstance(array $attributes = [])
    {
        return Model::unguarded(function () use ($attributes) {
            $instance = new $this->class(
                $this->getRawAttributes($attributes)
            );

            if (isset($this->connection)) {
                $instance->setConnection($this->connection);
            }

            return $instance;
        });
    }
382742
public function make(array $attributes = [])
    {
        if ($this->type === null) {
            throw new InvalidArgumentException("You have to set the type of file!");
        }

        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        }

        if ($this->amount < 1) {
            return collect();
        }

        return $this->makeCollection($attributes);
    }
1152071
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        }

        if ($this->amount < 1) {
            return (new $this->class)->newCollection();
        }

        return (new $this->class)->newCollection(array_map(function () use ($attributes) {
            return $this->makeInstance($attributes);
        }, range(1, $this->amount)));
    }
87380
public function create(array $attributes = [])
    {
        $results = $this->make($attributes);

        if ($results instanceof Model) {
            $results->save();
        } else {
            $results->each->save();
        }

        return $results;
    }
947819
public function attributes($attributes = null)
    {
        if (null === $attributes) {
            return $this->attributes;
        }

        $this->attributes = $attributes;

        return $this;
    }
1072925
public function withAttributes(array $attributes = []): Element
    {
        $this->attributes = array_merge(
            $this->attributes,
            $attributes
        );

        return $this;
    }
63081
public function setAttributes(array $attributes = null)
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        return $this;
    }
446666
protected function _create(array $attributes)
    {
        $model = $this->newModelInstance()->forceFill($attributes);

        $model->save();

        return $model;
    }
165283
public function create(array $attributes)
    {
        $instance = $this->related->newInstance($attributes);

        $instance->setAttribute($this->getPlainForeignKey(), $this->getParentKey());

        $instance->save();

        return $instance;
    }
628301
public function computer(array $attributes = [])
    {
        $model = $this->schema->computerModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->person(),
                $this->schema->organizationalPerson(),
                $this->schema->user(),
                $this->schema->computer(),
            ]);
    }
585075
public static function factory($attributes)
    {
        $defaultAttributes = [
        ];

        $instance = new self();
        $instance->_initialize(array_merge($defaultAttributes, $attributes));
        return $instance;
    }
917701
public static function create(array $attributes = [])
    {
        $attributes['password'] = bcrypt($attributes['password']);

        $user = new AppUser($attributes);
        $user->save();

        return $user;
    }
513919
public function create(array $attributes = [])
    {
        $results = $this->make($attributes);

        $this->getMapper()->store($results);

        return $results;
    }
393689
public function firstOrNew(array $attributes)
    {
        if (is_null($instance = $this->where($attributes)->first())) {
            $instance = $this->related->newInstance($attributes);

            $instance->setAttribute($this->getForeignKeyName(), $this->getParentKey());
        }

        return $instance;
    }
22764
public function create( array $attributes = [] )
	{
		$results = $this->make( $attributes );

		if ( $this->amount === 1 )
			$results->save();
		else
			foreach ( $results as $result )
				$result->save();

		return $results;
	}
787291
public function make(array $attributes=[])
    {
        $model = $this->model()->make($attributes);
        $this->callAfterListeners('make', [$model]);
        return $model;
    }
155968
public function create(array $attributes)
    {
        // Is this a bulk create?
        if (array_values($attributes) == $attributes) {
            $that = $this;
            $collection = new IlluminateCollection($attributes);
            return $collection->map(function($attrs) use ($that) { return $that->create($attrs); });
        }

        $model = $this->create_new($attributes);
        $model->save();

        // TODO: dry with 'queryEagerLoadRelations'
        $eagerLoads = $this->query->getEagerLoads();
        if (count($eagerLoads) > 0)
        {
            $relations = $this->query->eagerLoadRelations(array($model));
            $model = $relations[0];
        }

        return $model;
    }