Skip to content

Instantly share code, notes, and snippets.

View shealavington's full-sized avatar
🎯
Focusing on Self-Development

Shea Lavington shealavington

🎯
Focusing on Self-Development
View GitHub Profile
@shealavington
shealavington / auth.php
Last active February 19, 2022 13:53
Directus custom endpoint: Registration — Change what roles can be reigstered to in the `$roleMap` array, give it a friendly api-ready name, and a role id
<?php // Version 3.0
use Directus\Application\Http\Request;
use Directus\Application\Http\Response;
class User {
private $data;
private $role;
@shealavington
shealavington / troubleshoot.php
Last active August 9, 2019 10:58
Troubleshoot Directus by adding this as a custom extension. See if you've missed any of the requirements.
<?php
use Directus\Application\Http\Request;
use Directus\Application\Http\Response;
return [
'' => [
'method' => 'GET',
'handler' => function (Request $request, Response $response) {
// Simple GET endpoint example