Download the PHP package rashidhamidov/model-form without Composer
On this page you can find all versions of the php package rashidhamidov/model-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rashidhamidov/model-form
More information about rashidhamidov/model-form
Files in rashidhamidov/model-form
Package model-form
Short Description Dynamic Model Form for crate form automaticaly from model fields
License MIT
Informations about the package model-form
Laravel Model Form Package
This is package is for create dynamic crud forms for model.
- Laravel 8 is supported
These advantages are
- Create Dynamic Forms from Model file with one function
- Create Rules in Model file with one function
- Automatically Creates Forms which you want
- You can change the class names and can add more than one class name into form element
Inserting Trait to Model
Abstract Functions
setRootName() and setRules() is a mandatory functions for models that extends HasCrudForm trait
You have to override this functions for form post and request validation. If you set root name as product the form action will be route with names:
- product.store
- product.update
It automatically gets the model data id from your send with form function
Make Form Fields
There is a function for create form formFields() and returns an array. You can create form like this.
There are three type of elements and full type of those elements in form. You can also set className into array and required fields. In select filed you have to set array into array that values in it.
Call Form Function
Into your blade file form() function returns a views that comprise form of Model.
For Model Update Form you have to send model as variable which you want to change.
Before use form() function you have to define in your web.php file Model Controller Route resource or store and update routes for store and update routes
Rules Usage
After define rules you can use validation with this rule array
License
This package is developed by Rashid Hamidov for Laravel framework MIT license.