public function submission($formData)
    {
        $formRules = BlockFormRule::get_rules($this->_block->name.'-form');
        $v = Validator::make($formData, $formRules);
        if ($v->passes()) {

            foreach ($formData as $blockName => $content) {
                $fieldBlock = Block::preload($blockName);
                if ($fieldBlock->exists) {
                    if ($fieldBlock->type == 'datetime' && empty($content)) {
                        $content = new Carbon();
                    }
                    $formData[$blockName] = $content;
                }
            }

            $this->insertRow($formData);

            Email::sendFromFormData([$this->_block->name.'-form'], $formData, config('coaster::site.name') . ': New Form Submission - ' . $this->_block->label);

            return \redirect(Request::url());

        } else {
            FormMessage::set($v->messages());
        }

        return null;
    }
public function submission($formData)
    {
        $formRules = BlockFormRule::get_rules($this->_block->name.'-form');
        $v = Validator::make($formData, $formRules);
        if ($v->passes()) {

            foreach ($formData as $blockName => $content) {
                $fieldBlock = Block::preload($blockName);
                if ($fieldBlock->exists) {
                    if ($fieldBlock->type == 'datetime' && empty($content)) {
                        $content = new Carbon();
                    }
                    $formData[$blockName] = $content;
                }
            }

            $this->insertRow($formData);

            Email::sendFromFormData([$this->_block->name.'-form'], $formData, config('coaster::site.name') . ': New Form Submission - ' . $this->_block->label);

            return \redirect(Request::url());

        } else {
            FormMessage::set($v->messages());
        }

        return null;
    }
public function submission ( $ formData ) { $ formRules = BlockFormRule :: get_rules ( $ this -> _block -> name . '-form' ) ; $ v = Validator :: make ( $ formData , $ formRules ) ; if ( $ v -> passes ( ) ) { foreach ( $ formData as $ blockName => $ content ) { $ fieldBlock = Block :: preload ( $ blockName ) ; if ( $ fieldBlock -> exists ) { if ( $ fieldBlock -> type == 'datetime' && empty ( $ content ) ) { $ content = new Carbon ( ) ; } $ formData [ $ blockName ] = $ content ; } } $ this -> insertRow ( $ formData ) ; Email :: sendFromFormData ( [ $ this -> _block -> name . '-form' ] , $ formData , config ( 'coaster::site.name' ) . ': New Form Submission - ' . $ this -> _block -> label ) ; return \ redirect ( Request :: url ( ) ) ; } else { FormMessage :: set ( $ v -> messages ( ) ) ; } return null ; }
Repeater form submission
@param array $formData
@return null|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
Repeater form submission