RequestActionTrait
Provides helper methods for request actions
Tags
Table of Contents
Methods
- requires() : void
- This checks if the required fields are present in the request otherwise it throws an exception
- checkOne() : void
- Checks if a single field is present in the request data and is not null or empty
Methods
requires()
This checks if the required fields are present in the request otherwise it throws an exception
public
requires([array<string|int, mixed>|string $required = [] ]) : void
Parameters
- $required : array<string|int, mixed>|string = []
-
The fields that are required
Tags
checkOne()
Checks if a single field is present in the request data and is not null or empty
private
static checkOne(string $field, Arrayable $data) : void
Parameters
- $field : string
- $data : Arrayable