TypeRocket v1 Pro users can now upgrade to TypeRocket v5 at their convenience.
( v1 )
TypeRocket comes with a REST API that can be used to
destroy resources. You can access this API using the following URI scheme:
Form object has quick access to the JSON API via the
The JSON API passes through the kernel middleware for enhanced security. Modifications made to the Kernel will impact the REST API.
If you encounter issues, the REST API requires strict adherence to the controller action naming scheme:
By default, TypeRocket registers its custom post types and taxonomies and the default
page post types to the REST API automatically. However, if you have custom post types or taxonomies registered outside of TypeRocket and you want to use the REST API, you register those resources.
To register a post type need to do so using
To register a post type use the
\TypeRocket\Register\Registry::addPostTypeResource('book', [ 'singular' => 'book', 'plural' => 'books', 'controller' => '\App\Controllers\BookController', ]);
To register a taxonomy use the
\TypeRocket\Register\Registry::addTaxonomyResource('publisher', [ 'singular' => 'publisher', 'plural' => 'publishers', 'controller' => '\App\Controllers\PublisherController', ]);
If you want to access your custom resource using the TypeRocket REST API register is using the
\TypeRocket\Register\Registry::addCustomResource('test', [ 'controller' => '\App\Controllers\TestController', ]);
The TypeRocket REST API has special rules for loading the correct middleware group. See the middleware docs.
Found a typo? Something is wrong in this documentation? Fork and edit it!