Backend\FormWidgets\Relation\HasQuickCreate
Overview
HasQuickCreate adds the ability to create new related records from a dropdown, opening a popup form to create the record on the fly.
Public Properties
public mixed $quickCreate
quickCreate config for the quick create feature
Protected Properties
protected array $quickCreateConfig
quickCreateConfig resolved configuration
protected FormWidget|null $quickCreateFormWidget
Public Methods
public hasQuickCreate()
public hasQuickCreate(): bool
hasQuickCreate returns true if quick create should be active
public onLoadQuickCreateForm()
public onLoadQuickCreateForm(): void
onLoadQuickCreateForm AJAX handler to render the popup form
public onQuickCreateRecord()
public onQuickCreateRecord(): void
onQuickCreateRecord AJAX handler to create the new record
Protected Methods
protected addQuickCreateOption()
protected addQuickCreateOption($options): void
addQuickCreateOption prepends the quick create sentinel option to the dropdown
protected applyQuickCreateFieldDefaults()
protected applyQuickCreateFieldDefaults($field): void
applyQuickCreateFieldDefaults ensures an empty option exists so the quick create option is never selected by default when no entries are available
protected initQuickCreate()
protected initQuickCreate(): void
initQuickCreate parses the quickCreate config and prepares the form widget when processing a quick create request.
protected loadQuickCreateAssets()
protected loadQuickCreateAssets(): void
loadQuickCreateAssets loads the JS control for quick create
protected makeQuickCreateFormWidget()
protected makeQuickCreateFormWidget(): void
makeQuickCreateFormWidget creates the form widget for the popup