Create mail settings

@param mixed $data
@return \Laranix\Support\Mail\MailSettings
331029
protected function createSettings($data = null): MailSettings
    {
        if (method_exists($this, 'getPayload')) {
            $data = $this->getPayload($data);
        }

        if ($data instanceof MailSettings) {
            return $data;
        }

        return new $this->settings($data);
    }
1000521
protected function create(array $data)
    {
        $fields = [
            'name'     => $data['name'],
            'email'    => $data['email'],
            'password' => bcrypt($data['password']),
        ];
        if (config('auth.providers.users.field', 'email') === 'username' && isset($data['username'])) {
            $fields['username'] = $data['username'];
        }
        return User::create($fields);
    }
1094535
public function create($data)
    {
        $descriptor = new ThrowsDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setTypes(
            $this->builder->buildDescriptor(new Collection($data->getTypes()))
        );

        return $descriptor;
    }
375203
public static function createFromData(array $data)
    {
        if (!isset($data['type'])) {
            throw new DomainException(self::MSG_REQUIRED_TYPE);
        }

        switch ($data['type']) {
            case self::TYPE_FIXED:
                $discount = new Discounts\Fixed($data);

                break;
            case self::TYPE_PERCENT:
                $discount = new Discounts\Percent($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::MSG_UNSUPPORTED_TYPE, implode(',', self::$supportedTypes))
                );
        }

        return $discount;
    }
205194
public function write_setting($data) {
        if (!is_array($data)) {
            return ''; //ignore it
        }
        if (!$this->load_choices() or empty($this->choices)) {
            return '';
        }

        unset($data['xxxxx']);

        $save = array();
        foreach ($data as $value) {
            if (!array_key_exists($value, $this->choices)) {
                continue; // ignore it
            }
            $save[] = $value;
        }

        return ($this->config_write($this->name, implode(',', $save)) ? '' : get_string('errorsetting', 'admin'));
    }
504640
public function createFromImportedData($data)
    {
        $revision = new Revision();
        $revision->setReleasedAt(new \DateTime($data['released_at']));
        $revision->setReleasedBy($data['released_by']);
        $revision->setComment($data['comment']);
        foreach ($data['groups'] as $groupData) {
            $revision->addGroup($this->getGroupFactory()->createFromImportedData($groupData));
        }
        return $revision;
    }
1299643
public function create($data)
    {
        $traitDescriptor = new TraitDescriptor();

        $traitDescriptor->setFullyQualifiedStructuralElementName($data->getFqsen());
        $traitDescriptor->setName($data->getName());
        $traitDescriptor->setLine($data->getLocation()->getLineNumber());
        $traitDescriptor->setPackage($this->extractPackageFromDocBlock($data->getDocBlock()) ?: '');

        // Reflection library formulates namespace as global but this is not wanted for phpDocumentor itself
        $traitDescriptor->setNamespace(
            substr((string) $data->getFqsen(), 0, -strlen($data->getName()) - 1)
        );

        $this->assembleDocBlock($data->getDocBlock(), $traitDescriptor);

        $this->addProperties($data->getProperties(), $traitDescriptor);
        $this->addMethods($data->getMethods(), $traitDescriptor);

        return $traitDescriptor;
    }
666281
protected function create(array $data)
    {
        $admin = new Admin();

        $fields           = $this->tableFields();
        $data['password'] = bcrypt($data['password']);
        foreach ($fields as $field) {
            if (isset($data[$field])) {
                $admin->$field = $data[$field];
            }
        }

        $admin->save();
        $admin->roles()->sync(request('role_id'));
        $this->sendConfirmationNotification($admin, request('password'));

        return $admin;
    }
260086
public function create($data)
    {
        $fileDescriptor = new FileDescriptor($data->getHash());
        $fileDescriptor->setPackage(
            $this->extractPackageFromDocBlock($data->getDocBlock()) ?: $this->getBuilder()->getDefaultPackage()
        );

        $fileDescriptor->setName($data->getName());
        $fileDescriptor->setPath($data->getPath());
        if ($this->getBuilder()->getProjectDescriptor()->getSettings()->shouldIncludeSource()) {
            $fileDescriptor->setSource($data->getSource());
        }

        $fileDescriptor->setIncludes(new Collection($data->getIncludes()));
        $fileDescriptor->setNamespaceAliases(new Collection($data->getNamespaces()));

        $this->assembleDocBlock($data->getDocBlock(), $fileDescriptor);
        $this->overridePackageTag($data, $fileDescriptor);

        //$this->addMarkers($data->getMarkers(), $fileDescriptor);
        $this->addConstants($data->getConstants(), $fileDescriptor);
        $this->addFunctions($data->getFunctions(), $fileDescriptor);
        $this->addClasses($data->getClasses(), $fileDescriptor);
        $this->addInterfaces($data->getInterfaces(), $fileDescriptor);
        $this->addTraits($data->getTraits(), $fileDescriptor);

        return $fileDescriptor;
    }
1280634
public function create($data)
    {
        $descriptor = new MethodDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setMethodName($data->getMethodName());

        $response = new ReturnDescriptor('return');
        $response->setTypes($this->builder->buildDescriptor(new Collection($data->getTypes())));
        $descriptor->setResponse($response);

        foreach ($data->getArguments() as $argument) {
            $argumentDescriptor = $this->createArgumentDescriptorForMagicMethod($argument);
            $descriptor->getArguments()->set($argumentDescriptor->getName(), $argumentDescriptor);
        }

        return $descriptor;
    }
829302
public function create($data)
    {
        $interfaceDescriptor = new InterfaceDescriptor();

        $interfaceDescriptor->setFullyQualifiedStructuralElementName($data->getFqsen());
        $interfaceDescriptor->setName($data->getName());
        $interfaceDescriptor->setLine($data->getLocation()->getLineNumber());
        $interfaceDescriptor->setPackage($this->extractPackageFromDocBlock($data->getDocBlock()) ?: '');

        // Reflection library formulates namespace as global but this is not wanted for phpDocumentor itself
        $interfaceDescriptor->setNamespace(substr((string) $data->getFqsen(), 0, -strlen($data->getName()) - 1));

        $this->assembleDocBlock($data->getDocBlock(), $interfaceDescriptor);
        $this->addConstants($data->getConstants(), $interfaceDescriptor);
        $this->addMethods($data->getMethods(), $interfaceDescriptor);

        foreach ($data->getParents() as $interfaceClassName) {
            $interfaceDescriptor->getParent()->set((string) $interfaceClassName, $interfaceClassName);
        }

        return $interfaceDescriptor;
    }
869588
protected function create(array $data)
  {
    //Ceate User
    $user = User::create([
      'name' => $data['name'],
      'email' => $data['email'],
      'password' => bcrypt($data['password']),
    ]);

    //create Blank profile
    $profile = Profile::create([
      'user_id' => $user->id,
      'bio'     => '',
    ]);
    $profile->save();

    //Assign User Role
    $user->assign('user');
    return $user;
  }
358871
public function setData($data)
    {
        foreach ($data as $name => $value) {
            if ($this->has($name)) {
                $this->get($name)->setValue($value);
            }
        }
        return $this;
    }
203619
protected function create($data = null)
    {
        if ($this->hasMethod('__create') && is_callable([$this, '__create'])) {
            return $this->__create($data);
        }

        // notify observers about new data
        $this->notify();
    }
64491
protected function create(array $data)
    {
        return User::create([
            'first_name' => $data['first_name'],
            'last_name' => $data['last_name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
    }
763192
public static function createFromArray(array $data, SecuritySettingsInterface $sourceSettings = null)
    {
        if ($sourceSettings && !$sourceSettings instanceof self) {
            throw new \InvalidArgumentException('Provide an instance of DefaultSecuritySettings for $sourceSettings');
        }

        $settings = $sourceSettings ? clone $sourceSettings : new static();
        \assert($settings instanceof self);
        $settings->mergeSettings($data);

        return $settings;
    }
266919
public static function fromArray($data)
    {
        $email = new SimpleEmail();
        $email->setSubject($data["subject"]);

        foreach($data["recipients"] as $recipient){
            $email->addRecipientByEmail($recipient["email"], $recipient["name"]);
        }

        foreach($data["attachments"] as $attachment){
            $email->addAttachment($attachment["path"], $attachment["name"]);
        }

        $email->setReplyToRecipient($data['ReplyTo']['email'], $data['ReplyTo']['name']);

        $email->setText($data["text"]);
        $email->setHtml($data["html"]);
        $email->setSender($data["sender"]["email"], $data["sender"]["name"]);

        return $email;
    }