Meilisearch PHP | Documentation

CreateKeyQuery
in package

FinalYes

Table of Contents

Properties

$actions  : array<string|int, mixed>
$description  : string|null
$expiresAt  : DateTimeImmutable|null
$indexes  : array<string|int, mixed>
$name  : string|null
$uid  : string|null

Methods

__construct()  : mixed
toArray()  : array{actions: list, indexes: list, description: non-empty-string|null, name: non-empty-string|null, expiresAt: non-empty-string|null, uid?: non-empty-string}

Properties

$expiresAt read-only

private DateTimeImmutable|null $expiresAt = null

Methods

__construct()

public __construct(array<int, KeyAction$actions, array<int, non-empty-string> $indexes[, non-empty-string|null $name = null ][, non-empty-string|null $description = null ][, non-empty-string|null $uid = null ][, DateTimeImmutable|null $expiresAt = null ]) : mixed
Parameters
$actions : array<int, KeyAction>

a list of actions permitted for the key

$indexes : array<int, non-empty-string>

A list of accessible indexes permitted for the key. [""] for all indexes. The * character can be used as a wildcard when located at the last position. e.g. products_ to allow access to all indexes whose names start with products_.

$name : non-empty-string|null = null

A human-readable name for the key. null if empty.

$description : non-empty-string|null = null

A description for the key. null if empty.

$uid : non-empty-string|null = null

A uuid v4 to identify the API Key. If not specified, it's generated by Meilisearch.

$expiresAt : DateTimeImmutable|null = null

Represent the expiration date and time as RFC 3339 format. null equals to no expiration time.

toArray()

public toArray() : array{actions: list, indexes: list, description: non-empty-string|null, name: non-empty-string|null, expiresAt: non-empty-string|null, uid?: non-empty-string}
Return values
array{actions: list, indexes: list, description: non-empty-string|null, name: non-empty-string|null, expiresAt: non-empty-string|null, uid?: non-empty-string}

        
On this page

Search results