Create a new resource by the given attributes

@param array $attributes
@return mixed The created resource
334696
public function store(array $attributes)
    {

        $this->validate($attributes, 'store');

        $filtered = $this->toModelAttributes($this->make([]), $attributes);

        $this->callBeforeListeners('store', [&$attributes]);

        $model = $this->model()->createRoot($filtered);

        $this->callAfterListeners('store', [$model]);

        return $model;

    }
547103
public static function createOne(array $attributes)
    {
        return tap(new self($attributes), function (self $post) use ($attributes) {
            $post->save();

            $post->tags()->sync($attributes['tags']);

            $post->createSeo(
                static::extractSeoAttributes($attributes)
            );
        });
    }
1246153
public function create(array $attributes = [])
    {
        // Create a new instance
        $instance = $this->createModel();

        // Fill instance with data
        $instance->fill($attributes);

        // Save the instance
        $created = $instance->save();

        // Fire the created event
        $this->getContainer('events')->fire($this->getRepositoryId().'.entity.created', [$this, $instance]);

        // Return instance
        return [
            $created,
            $instance,
        ];
    }
652847
public function newModelInstance($attributes = [])
    {
        return \tap(parent::newModelInstance($attributes), function ($model) {
            $model->setTenantor($this->tenantor);
        });
    }
917701
public static function create(array $attributes = [])
    {
        $attributes['password'] = bcrypt($attributes['password']);

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

        return $user;
    }
1167723
public function create($attributes = [])
    {
        $params = [];

        $params = $this->addPayout($params, $attributes);
        $params = $this->addPayoutMethod($params, $attributes);
        $params = $this->addPayoutBilling($params, $attributes);

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('payees'), $params);
    }
602204
public function create($attributes = [])
    {
        $params = [
            'name'  => Arr::get($attributes, 'name'),
            'email' => Arr::get($attributes, 'email'),
        ];

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('customer'), $params);
    }
1060008
public static function create($attributes = [])
    {
        try {
            self::init();
            foreach ($attributes as $column => $value) {
                $columns[] = $column;
                $values[] = ':'.$column;
            }

            $sql = 'INSERT INTO ' . self::$modelTable . ' (' . implode(',', $columns) . ') VALUES (' . implode(',', $values) . ')';
            $stm = self::$connect->prepare($sql);
            $stm->execute($attributes);
            return self::find(self::$connect->lastInsertId());
        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
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);
    }
1327512
public function create(array $attributes)
	{
		$foreign = array(
			$this->getPlainForeignKey() => $this->getParentKey(),
		);

		// Here we will set the raw attributes to avoid hitting the "fill" method so
		// that we do not have to worry about a mass accessor rules blocking sets
		// on the models. Otherwise, some of these attributes will not get set.
		$instance = $this->related->newInstance();

		$instance->setRawAttributes(array_merge($attributes, $foreign));

		$instance->save();

		return $instance;
	}
17776
public static function fromArray(array $attributes)
    {
        return new self(
            $attributes['id'],
            $attributes['name'],
            $attributes['price'],
            $attributes['quantity'],
            Arr::get($attributes, 'options', [])
        );
    }
788330
public static function make($attributes = [])
    {
        $jobset = new static();

        // make jobset model
        $model = $jobset->makeModel($attributes);
        // update local model
        $jobset->setModel($model);
        // make job models and init job instances
        $jobset->makeJobs();
        // set jobset try at
        $jobsetTryAt = $jobset->getJobsEarliestTryAt();
        $jobset->model->setTryAt($jobsetTryAt);
        $jobset->model->persist();

        return $jobset;
    }
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
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;
	}
413315
public static function create(array $attributes = [])
    {
        $site_id = site()->id;

        $contact = new static;

        $fillable = $contact->getFillable();

        foreach (array_only($attributes, $fillable) as $key => $value) {

            if  (is_array($value)) {
                $value = json_encode($value);
            }
            $row = Setting::privateOnly()->firstOrNew(compact('key', 'site_id'));
            $row->fill(compact('value'));
            $row->save();
        }

        return true;
    }
578031
public function create(array $attributes)
	{
		if ( ! isset($credentials['permissions']) )
		{
			$credentials['permissions'] = array();
		}

		$group = $this->createModel();
		$group->values($attributes, array('name', 'permissions'));
		$group->save();

		return $group;
	}
967188
public function create(array $attributes): bool
    {
        $model = $this->getModel();
        $model->setAttributes($attributes);

        return $model->save();
    }