am2studio / laravel-admin-form
Admin form helper
Installs: 4 989
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 12
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/support: ~5.1
This package is not auto-updated.
Last update: 2024-12-17 05:17:36 UTC
README
Install
Via Composer
$ composer require am2studio/laravel-admin-form
Register service provider in your app.php
AM2Studio\LaravelAdminForm\AdminFormServiceProvider::class,
Register the facade in your app.php
'AdminForm' => AM2Studio\LaravelAdminForm\AdminFormFacade::class,
You can use default templates or if you want to use your own templates you can publish views and edit them
php artisan vendor:publish --provider="AM2Studio\LaravelAdminForm\AdminFormServiceProvider" --tag=views
Usage
Inside template:
{!! AdminForm::text($name, $value, $options) !!}
the list of helpers:
{!! AdminForm::text() !}}
{!! AdminForm::number() !}}
{!! AdminForm::radio() !}}
{!! AdminForm::password() !}}
{!! AdminForm::textarea() !}}
{!! AdminForm::select() !}}
{!! AdminForm::date() !}}
{!! AdminForm::checkbox() !}}
{!! AdminForm::submit() !}}
they all accept same parameters as Form::
helpers
There is another helper method
{!! AdminForm::row($label, $adminFormElement) !!}
example
{!! AdminForm::row(trans('ui.first_name'), AdminForm::text('first_name', $user->first_name)) !!}
this will render into
<tr>
<td>First Name</td>
<td>
<div class="card-form">
<fieldset class="no-inline-edit">
<input placeholder="Enter first name here" name="first_name" type="text" value="Am2">
<button data-js="submit-field" type="submit"><i class="fa fa-check"></i></button>
<i class="fieldset-overlay" data-js="focus-on-field"></i>
</fieldset>
</div>
</td>
</tr>
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.