From 25df6996e6f3165ef3c412c3f97b80fe3489c31c Mon Sep 17 00:00:00 2001 From: Snider Date: Mon, 9 Mar 2026 17:25:40 +0000 Subject: [PATCH] feat(plug): add contract interfaces and Registry::register() method Move 8 plug contract interfaces (Authenticable, Commentable, Deletable, Listable, MediaUploadable, Postable, Readable, Refreshable) from the Laravel app into the framework under Core\Plug\Contract namespace. Add register() method to Registry so extracted packages can self-register their providers without filesystem scanning. Co-Authored-By: Claude Opus 4.6 --- src/Plug/Contract/Authenticable.php | 45 +++++++++++++++++++++++++++ src/Plug/Contract/Commentable.php | 22 +++++++++++++ src/Plug/Contract/Deletable.php | 18 +++++++++++ src/Plug/Contract/Listable.php | 21 +++++++++++++ src/Plug/Contract/MediaUploadable.php | 20 ++++++++++++ src/Plug/Contract/Postable.php | 23 ++++++++++++++ src/Plug/Contract/Readable.php | 25 +++++++++++++++ src/Plug/Contract/Refreshable.php | 20 ++++++++++++ src/Plug/Registry.php | 15 +++++++++ 9 files changed, 209 insertions(+) create mode 100644 src/Plug/Contract/Authenticable.php create mode 100644 src/Plug/Contract/Commentable.php create mode 100644 src/Plug/Contract/Deletable.php create mode 100644 src/Plug/Contract/Listable.php create mode 100644 src/Plug/Contract/MediaUploadable.php create mode 100644 src/Plug/Contract/Postable.php create mode 100644 src/Plug/Contract/Readable.php create mode 100644 src/Plug/Contract/Refreshable.php diff --git a/src/Plug/Contract/Authenticable.php b/src/Plug/Contract/Authenticable.php new file mode 100644 index 0000000..4389077 --- /dev/null +++ b/src/Plug/Contract/Authenticable.php @@ -0,0 +1,45 @@ +discovered = true; } + /** + * Register a provider programmatically. + * + * Used by plug packages to self-register without filesystem scanning. + */ + public function register(string $identifier, string $category, string $name, string $namespace): void + { + $this->providers[$identifier] = [ + 'category' => $category, + 'name' => $name, + 'namespace' => $namespace, + 'path' => null, + ]; + } + /** * Get all registered provider identifiers. *