Menu

## RequestActionTrait

RequestActionTrait.php : 13

Provides helper methods for request actions

##### Tags

author

  Jet - ezrajet9@gmail.com

### 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()

RequestActionTrait.php : 35

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

throws
  FailedRequiredException

  if a required field is not present in the request

#### checkOne()

RequestActionTrait.php : 23

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

##### Tags

throws
  FailedRequiredException

## Search results