class WorkingHour extends FormRequest

Traits

Adds event related features to any class.

Constants

protected DATA_TYPE_FORM

protected DATA_TYPE_POST

protected DATA_TYPE_INPUT

Properties

protected array $emitterSingleEvents from  EventEmitter
protected array $emitterEvents from  EventEmitter
protected array $emitterEventSorted from  EventEmitter
protected AdminController $controller from  FormRequest
protected $inputKey from  FormRequest

Methods

bool
getInjectRuleParameters()

Returns whether or not the model will add it's unique identifier to the rules when validating.

void
setInjectRuleParameters(bool $value)

Set the model to add unique identifier to rules when performing validation.

array
injectParametersToRules(array $rules)

If the model already exists and it has unique validations it is going to fail validation unless we also pass it's primary key to the rule so that it may be ignored.

mixed
getRuleInjectorMethod(string $validationRule)

Get the dynamic method name for a unique identifier or custom injector rule if it exists, otherwise return false.

string
prepareUniqueRule(array $parameters, string $field)

Prepare a rule, adding the table name, column and model identifier if required.

string
prepareUniqueWithRule(array $parameters, string $field)

Prepare a unique_with rule, adding the model identifier if required.

bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

void
emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

unbindEvent(string $event = null)

Destroys an event binding.

string|array
fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

mixed
getController()

No description

setController(mixed $controller)

No description

bool|string
getInputKey()

No description

setInputKey(bool|string $inputKey)

No description

getWith($key, $default = null)

No description

inputWith($key, $default = null)

No description

useDataFrom()

No description

getForm()

No description

Model|mixed
getModel()

No description

Validator
createDefaultValidator(Factory $factory)

Create the default validator instance.

array
validationData()

Get data to be validated from the request.

void
failedValidation(Validator $validator)

Handle a failed validation attempt.

attributes()

No description

rules()

No description

Details

in RuleInjector at line 15
bool getInjectRuleParameters()

Returns whether or not the model will add it's unique identifier to the rules when validating.

Return Value

bool

in RuleInjector at line 27
void setInjectRuleParameters(bool $value)

Set the model to add unique identifier to rules when performing validation.

Parameters

bool $value

Return Value

void

in RuleInjector at line 44
protected array injectParametersToRules(array $rules)

If the model already exists and it has unique validations it is going to fail validation unless we also pass it's primary key to the rule so that it may be ignored.

This will go through all the rules and append the model's primary key to the unique rules so that the validation will work as expected.

Parameters

array $rules

Return Value

array

in RuleInjector at line 76
protected mixed getRuleInjectorMethod(string $validationRule)

Get the dynamic method name for a unique identifier or custom injector rule if it exists, otherwise return false.

Parameters

string $validationRule

Return Value

mixed

in RuleInjector at line 91
protected string prepareUniqueRule(array $parameters, string $field)

Prepare a rule, adding the table name, column and model identifier if required.

Parameters

array $parameters
string $field

Return Value

string

in RuleInjector at line 140
protected string prepareUniqueWithRule(array $parameters, string $field)

Prepare a unique_with rule, adding the model identifier if required.

Parameters

array $parameters
string $field

Return Value

string

in EventEmitter at line 36
EventEmitter bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

Parameters

string $event

The event name to listen for

callable $callback

The callback to call when emitted

int $priority

Return Value

EventEmitter

in EventEmitter at line 52
EventEmitter bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

Parameters

string $event

The event name

callable $callback

Return Value

EventEmitter

in EventEmitter at line 66
protected void emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

Parameters

string $eventName

Return Value

void

in EventEmitter at line 84
EventEmitter unbindEvent(string $event = null)

Destroys an event binding.

Parameters

string $event

Event to destroy

Return Value

EventEmitter

in EventEmitter at line 124
string|array fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

string|array

Collection of event results / Or single result (if halted)

in EventEmitter at line 178
mixed fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

For example:

$this->fireSystemEvent('admin.form.myEvent', ['my value']);

Is equivalent to:

$this->fireEvent('form.myEvent', ['myvalue'], true);

Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

mixed

in FormRequest at line 36
mixed getController()

No description

Return Value

mixed

in FormRequest at line 45
setController(mixed $controller)

No description

Parameters

mixed $controller

in FormRequest at line 55
bool|string getInputKey()

No description

Return Value

bool|string

in FormRequest at line 64
FormRequest setInputKey(bool|string $inputKey)

No description

Parameters

bool|string $inputKey

Return Value

FormRequest

in FormRequest at line 71
getWith($key, $default = null)

No description

Parameters

$key
$default

in FormRequest at line 79
inputWith($key, $default = null)

No description

Parameters

$key
$default

at line 37
protected useDataFrom()

No description

in FormRequest at line 96
protected Form getForm()

No description

Return Value

Form

Exceptions

SystemException

in FormRequest at line 104
protected Model|mixed getModel()

No description

Return Value

Model|mixed

in FormRequest at line 122
protected Validator createDefaultValidator(Factory $factory)

Create the default validator instance.

Parameters

Factory $factory

Return Value

Validator

in FormRequest at line 152
array validationData()

Get data to be validated from the request.

Return Value

array

in FormRequest at line 176
protected void failedValidation(Validator $validator)

Handle a failed validation attempt.

Parameters

Validator $validator

Return Value

void

Exceptions

ValidationException

at line 9
attributes()

No description

at line 23
rules()

No description