Download the PHP package reedware/nova-field-manager without Composer
On this page you can find all versions of the php package reedware/nova-field-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-field-manager
Nova Field Manager
This package provides the convenience of not having to include the class path of each individual field in your resource class declaration. A new Field
facade will be created, where you can defer all field creation through.
Installation
Require this package with composer.
Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the service provider or facade. However, should you still need to reference them, here are their class paths:
Usage
You can now add fields to your resources in Nova by using the Field
facade, rather than having to include each individual field in your resource class definition.
Custom Fields
All of the fields are configured in the nova-fields
configuration file. First, you will need to create your own copy, by either running the php artisan vendor:publish
command, or by copying the configuration file directory from this repository (found in ~/config/nova-fields.php
).
You can easily add your own (or override the default fields) by manipulating this configuration file. The config key (id
, text
, hasMany
, etc) is the method that you can call from the Field
facade. The config value is the class path to the field, where a call to Field::<key>(...)
defers to <value>::make(...)
.
The default fields provided by Nova will automatically be added, even if they are not present in your configuration file. However, if you have overridden one of the default fields (by specifying the same key name), your field will override the default Nova field.
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
Field::custom(...)
];
}