Creates a new user instance.

@param array $attributes

@return User
497279
public function user(array $attributes = [])
    {
        $model = $this->schema->userModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), $this->schema->userObjectClasses());
    }
189228
public function make(array $attributes = [])
    {
        $instance = $this->related->newInstance($attributes);
        $instance->setAttribute($this->getForeignKeyName(), $this->getParentKey());
        return $instance;
    }
927738
public function fill(array $attributes = [])
    {
        foreach ($attributes as $key => $value) {
            $this->setAttribute($key, $value);
        }

        return $this;
    }
413297
public function make(array $attributes=[])
    {
        $model = $this->getModel()->newInstance($attributes);
        $this->fire($this->event('make'), [$model]);
        return $model;
    }
63447
public function newFromBuilder($attributes = array())
    {
        $m = $this->mapData((array) $attributes)->newInstance(array(), true);
        $m->setRawAttributes((array) $attributes, true);
        return $m;
    }
17776
public static function fromArray(array $attributes)
    {
        return new self(
            $attributes['id'],
            $attributes['name'],
            $attributes['price'],
            $attributes['quantity'],
            Arr::get($attributes, 'options', [])
        );
    }
227487
public function create(array $attributes)
    {
        $user = new User($attributes);

        if ($user->hasAttribute('password') && !$this->connection->canChangePasswords()) {
            throw new AdldapException('SSL must be configured on your web server and enabled in the class to set passwords.');
        }

        // Translate the schema
        $add = $this->adldap->ldapSchema($user->toCreateSchema());

        // Additional stuff only used for adding accounts
        $add['cn'][0] = $user->getAttribute('display_name');
        $add[$this->adldap->getUserIdKey()][0] = $user->getAttribute('username');
        $add['objectclass'][0] = 'top';
        $add['objectclass'][1] = 'person';
        $add['objectclass'][2] = 'organizationalPerson';
        $add['objectclass'][3] = 'user';

        // Set the account control attribute
        $controlOptions = ['NORMAL_ACCOUNT' => true];

        if (!$user->hasAttribute('enabled')) {
            $controlOptions['ACCOUNTDISABLE'] = true;
        }

        $add['userAccountControl'][0] = $this->accountControl($controlOptions);

        // Determine the container
        $attributes['container'] = array_reverse($user->getAttribute('container'));

        $container = 'OU='.implode(',OU=', $user->getAttribute('container'));

        $dn = 'CN='.$add['cn'][0].','.$container.','.$this->adldap->getBaseDn();

        // Add the entry
        return $this->connection->add($dn, $add);
    }
658809
public function newInstance($attributes = [], $exists = false)
    {
        $model = new static();
        $model->fill((array) $attributes, $exists);
        $model->syncOriginal();

        $model->exists = $exists;

        $model->setConnection($this->getConnectionName());

        return $model;
    }
827246
public function firstOrCreate( array $attributes )
	{
		if ( !is_null( $instance = $this->where( $attributes )->first() ) )
			return $instance;

		$instance = $this->model->newInstance( $attributes );

		$instance->save();

		return $instance;
	}
105236
public function create(array $attributes)
    {
        $group = new Group($attributes);

        $group->validateRequired();

        // Reset the container by reversing the current container
        $group->setAttribute('container', array_reverse($group->getAttribute('container')));

        $add['cn'] = $group->getAttribute('group_name');
        $add['samaccountname'] = $group->getAttribute('group_name');
        $add['objectClass'] = 'Group';
        $add['description'] = $group->getAttribute('description');

        $container = 'OU='.implode(',OU=', $group->getAttribute('container'));

        $dn = 'CN='.$add['cn'].', '.$container.','.$this->adldap->getBaseDn();

        return $this->connection->add($dn, $add);
    }
87380
public function create(array $attributes = [])
    {
        $results = $this->make($attributes);

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

        return $results;
    }
705374
protected function createLocalUser(string $provider, array $attributes)
    {
        $localUser = app('cortex.auth.member');

        $attributes['password'] = str_random();
        $attributes['email_verified_at'] = now();
        $attributes['is_active'] = ! config('cortex.auth.registration.moderated');

        $localUser->fill($attributes)->save();

        // Fire the register success event
        event(new Registered($localUser));

        $localUser->socialites()->create([
            'provider' => $provider,
            'provider_uid' => $attributes['id'],
        ]);

        return $localUser;
    }
773229
public static function create(array $attributes = [])
    {
        $className = get_called_class();
        /** @var ModelInterface $model */
        $model = new $className($attributes);
        $model->setIsNewRecord(false);

        return $model;
    }
585075
public static function factory($attributes)
    {
        $defaultAttributes = [
        ];

        $instance = new self();
        $instance->_initialize(array_merge($defaultAttributes, $attributes));
        return $instance;
    }
945868
public static function factory($attributes)
    {
        $instance = new self();
        $instance->revokedPaymentMethod = PaymentMethodParser::parsePaymentMethod($attributes);
        $instance->customerId = $instance->revokedPaymentMethod->customerId;
        $instance->token = $instance->revokedPaymentMethod->token;
        return $instance;
    }
652461
public function newFromBuilder($attributes = [])
    {
        $instance = $this->newInstance([], true);

        $instance->setRawAttributes((array) $attributes, true);

        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(),
            ]);
    }