Skip to content

Latest commit

 

History

History
128 lines (84 loc) · 2.29 KB

Admin-Form.md

File metadata and controls

128 lines (84 loc) · 2.29 KB

Overview

This feature extends the Laravel Collective Forms & Html package.

It adds ability to easily add form fields with the form_admin() helper or FormAdmin facade just like you would normally do any other field.

The difference is that this form helper is for the admin section of the site.

When adding admin form fields the admin form helper or facade wraps them inside additional specific admin html.

Usage

Open a form.

{!! form_admin()->open(['url' => 'url', 'method' => 'POST', 'files' => true]) !!}

Close a form.

{!! form_admin()->close() !!}

Form model binding.

{!! form_admin()->model($model, ['url' => 'url', 'method' => 'PUT', 'files' => true]) !!}

Create a submit button.

{!! form_admin()->submit('value') !!}

Create a hidden input.

{!! form_admin()->hidden('name', 'value') !!}

Create a text input.

{!! form_admin()->text('name', 'label') !!}

Create a textarea input.

{!! form_admin()->textarea('name', 'label') !!}

Create a select input.

{!! form_admin()->select('name', 'label', ['op_1' => 'Opt 1', 'op_2' => 'Opt 2']) !!}

Create a password input.

{!! form_admin()->password('name', 'label') !!}

Create a file input.

{!! form_admin()->file('name', 'label') !!}

Create a number input.

{!! form_admin()->number('name', 'label') !!}

Create a email input.

{!! form_admin()->email('name', 'label') !!}

Create a phone input.

{!! form_admin()->phone('name', 'label') !!}

Create a checkbox input.

{!! form_admin()->checkbox('name', 'label', $value, $checked) !!}

Create a radio input.

{!! form_admin()->radio('name', 'label', $value, $checked) !!}

Create a editor input using TinyMCE.

{!! form_admin()->editor('name', 'label') !!}

Create a calendar input using jQuery DatePicker.

{!! form_admin()->calendar('name', 'label') !!}

Create a time input using jQuery TimePicker.

{!! form_admin()->time('name', 'label') !!}

Create a color input using jQuery ColorPicker.

{!! form_admin()->color('name', 'label') !!}