kawax/laravel-laminas-form

View on GitHub
src/Commands/stubs/form.stub

Summary

Maintainability
Test Coverage
<?php

namespace DummyNamespace;

use Revolution\LaminasForm\Form;
use Laminas\Form\Element;

class DummyClass extends Form
{
    /**
     * Create a new form.
     *
     * @param null|string $name
     *
     * @return void
     */
    public function __construct($name = null)
    {
        parent::__construct($name);

        $this->setAttributes([
            'action' => '/',
            'method' => 'post',
        ]);

        $this->add([
            'type'       => Element\Hidden::class,
            'name'       => '_token',
            'attributes' => [
                'value' => csrf_token(),
            ],
        ]);

        //
    }
}