2024-07-03 15:25:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Appwrite\Client;
|
|
|
|
|
use Appwrite\Services\Databases;
|
|
|
|
|
|
|
|
|
|
$client = (new Client())
|
|
|
|
|
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
2024-08-21 09:16:51 +00:00
|
|
|
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
|
|
|
|
->setKey('<YOUR_API_KEY>'); // Your secret API key
|
2024-07-03 15:25:40 +00:00
|
|
|
|
|
|
|
|
$databases = new Databases($client);
|
|
|
|
|
|
|
|
|
|
$result = $databases->createEnumAttribute(
|
|
|
|
|
databaseId: '<DATABASE_ID>',
|
|
|
|
|
collectionId: '<COLLECTION_ID>',
|
|
|
|
|
key: '',
|
|
|
|
|
elements: [],
|
|
|
|
|
required: false,
|
|
|
|
|
default: '<DEFAULT>', // optional
|
|
|
|
|
array: false // optional
|
|
|
|
|
);
|