class StoreLabelTreeMerge extends FormRequest

Properties

LabelTree $tree

The label tree to create/remove the labels of.

array $create

Flat array of labels to create.

array $remove

Array of label IDs to remove.

Methods

bool
authorize()

Determine if the user is authorized to make this request.

array
rules()

Get the validation rules that apply to the request.

void
withValidator(Validator $validator)

Configure the validator instance.

validateCreate(Validator $validator)

Validate the create labels.

validateRemove(Validator $validator)

Validate the remove labels.

array
getFlatLabels(array $labels, array $carry = [], int $index = -1)

Returns a flat list of a nested array of labels and assigns a parent_index to each label, which indicates the position of the parent label in the list (as opposed to a parent_id, sinde the labels have no ID yet).

Details

at line 38
bool authorize()

Determine if the user is authorized to make this request.

Return Value

bool

at line 52
array rules()

Get the validation rules that apply to the request.

Return Value

array

at line 66
void withValidator(Validator $validator)

Configure the validator instance.

Parameters

Validator $validator

Return Value

void

at line 83
protected validateCreate(Validator $validator)

Validate the create labels.

Parameters

Validator $validator

at line 121
protected validateRemove(Validator $validator)

Validate the remove labels.

Parameters

Validator $validator

at line 155
protected array getFlatLabels(array $labels, array $carry = [], int $index = -1)

Returns a flat list of a nested array of labels and assigns a parent_index to each label, which indicates the position of the parent label in the list (as opposed to a parent_id, sinde the labels have no ID yet).

Parameters

array $labels
array $carry
int $index

Return Value

array