### Install Authzed PHP Client via Composer Source: https://github.com/linkorb/spicedb-php/blob/main/README.md Use the Composer dependency manager to add the linkorb/spicedb-php library to your project. ```shell composer require linkorb/spicedb-php ``` -------------------------------- ### Perform Write Schema API Call in PHP Source: https://github.com/linkorb/spicedb-php/blob/main/README.md Shows an example of using the initialized SpiceDB client to perform a write schema operation, defining object types and their relations and permissions. ```php $client->writeSchema(new \LinkORB\Authzed\Dto\Request\Schema( 'definition blog/post { relation reader: blog/user relation writer: blog/user permission read = reader + writer permission write = writer } definition blog/user {}' )); ``` -------------------------------- ### Run Integration Tests with Docker Source: https://github.com/linkorb/spicedb-php/blob/main/README.md Execute the library's integration tests using the `make` command, which typically leverages Docker to set up the necessary environment. ```shell make run-test ``` -------------------------------- ### Run Integration Tests with PHPUnit Source: https://github.com/linkorb/spicedb-php/blob/main/README.md Execute the library's integration tests directly using the PHPUnit command-line tool, specifying the configuration file and test suite. ```shell phpunit -c ./phpunit.xml --testsuite 'Integration' ./tests/ ``` -------------------------------- ### Initialize SpiceDB Client in PHP Source: https://github.com/linkorb/spicedb-php/blob/main/README.md Demonstrates how to instantiate the SpiceDB client using pure PHP, relying on Symfony components like HttpClient and Serializer for communication and data handling. ```php use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\Serializer\Encoder\JsonEncoder; use LinkORB\Authzed\Serializer\JsonLinesDecoder; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use Symfony\Component\Serializer\Normalizer\UnwrappingDenormalizer; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Serializer; new SpiceDB( new Serializer( [new ArrayDenormalizer(), new UnwrappingDenormalizer(), new ObjectNormalizer(null, null, null, new ReflectionExtractor())], [new JsonEncoder(), new JsonLinesDecoder()] ), HttpClient::create(), getenv('SPICEDB_HOST'), getenv('SPICEDB_API_KEY') ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.