Download the PHP package armincms/json without Composer
On this page you can find all versions of the php package armincms/json. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download armincms/json
More information about armincms/json
Files in armincms/json
Informations about the package json
json
A laravel nova field
Table of Contents
- Install
- Usage
- Nested Usage
- Action Usage
- Showing / Hiding Fields
- Last Values
- Separated Data
- Fill The Value
- Null Values
- Auto Casting
- About Implementation
Install
Usage
So simple.
Nested Usage
Storing nested data is very like straight data. just like the following; use the Json
nested.
Action Usage
It is possible to use the Json
in the Action
like follow:
Showing And Hiding Fields
you can use the field show/hide
methods on the JSON field. so this method will be called on each field under the Json
field.The following example will hide all fields from the index
view.
Save Last Values
By default; we clean the last data for store new data. but, it's possible to save the last data. for this, call the saveHistory
method on parent Json
class. this causes us to overwrite the new data without clean the last data. see the follow:
Separated Data
If you want store fields in one column but show in a separate place; you should make multiple Json
field by one name.see the following:
- ATTENTION: at this situation, you should use
saveHistory
for nextJson
field.
Fill The Value
if you want to store the customized value of the field; you can use the fillUsing
method and return custom value. see the follow:
fillUsing
accept three argumnets$request
,$attribute
,$requestAttribute
.
Null Values
If there need to store some values as the null
; you can use the nullable
method that works like the Nova nullable.
By default; nullable has the true
value which means all values will be stored. But; It's possible to reject the storing of null values via passing the false
value into the nullable
method.
Auto Casting
If not defined JSON casting for the field attribute; we will convert the field Value into JSON.
if you need disable this feature; use the ignoreCasting
method;
About Implementation
Maybe there exists a question about how this package works?
I Should say that; this package doesn't have any corresponds component to the Vuejs
.
this package just uses callback
's for data storing. so; won't changed any field.
with this implementation, you have access to your original fields without changes.
So; for interacts with other packages or fields, exists toArray
method to access to defined fields.