LMongo\Eloquent\Relations\BelongsToMany::create PHP Метод

create() публичный Метод

Create a new instance of the related model.
public create ( array $attributes ) : Model
$attributes array
Результат LMongo\Eloquent\Model
    public function create(array $attributes)
    {
        $instance = $this->related->newInstance($attributes);
        // Once we save the related model, we need to attach it to the base model via
        // through intermediate table so we'll use the existing "attach" method to
        // accomplish this which will insert the record and any more attributes.
        $instance->save();
        $this->attach($instance);
        return $instance;
    }