Download the PHP package ericphamhoang/belongs-to-many-field without Composer
On this page you can find all versions of the php package ericphamhoang/belongs-to-many-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ericphamhoang/belongs-to-many-field
More information about ericphamhoang/belongs-to-many-field
Files in ericphamhoang/belongs-to-many-field
Package belongs-to-many-field
Short Description belongsToMany nova representation in field.
License MIT
Informations about the package belongs-to-many-field
Belongs To Many Field Nova
Belongs To Many field to represent many to many relationship in field. This Field allow attaching relationships easily, you can pass query to the Multiple Select.
Installation
Deprecation
Method relationModel() no more needed, to prevent conflicts it will be there. And trait HasBelongsToMany no more neede too, both will be in repo, but doesn't work.
Usage
To use in nova 1.0 use 0.3 in nova 2.0 use 0.4 and above.
In the resource you need to pass:
- Method make (label, many to many relationship, Nova Resource Relationship)
- Method options (Here you pass options that you need to render in Multiple Select, you can pass Querys, use get() method for that purpose)
- You dont need to pass onlyOnForms(), it is by default.
Optional
-
Method optionsLabel('columnName'), this method is when you don't have column 'name' in your table and you want to label by another column name. By default it tracks by label 'name'
- Method isAction(), this method is when you need this field in actions, this puts height of field in 350px, and converts in action.
To obtain the data that is send in action do it:
Validations
This package implement all Laravel Validations, you need to pass the rules in rules method, rules are listed on laravel validations rules for arrays*.
For translations of this validations, use normal laravel validations translations.
Todo
Implement validations, implement custom rules
Contributing
-Pull Requests -Issues -Or Contact me: [email protected]