### Install Dependencies with npm Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/asset/README.md Installs all project dependencies required for contributing to Laminas API Tools. ```shell npm install ``` -------------------------------- ### Install Dependencies with Bower Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/asset/README.md Installs frontend dependencies using Bower, necessary for Laminas API Tools asset development. ```shell bower install ``` -------------------------------- ### Install Laminas API Tools via Composer Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/README.md This command installs the Laminas API Tools package and its dependencies using Composer, the PHP dependency manager. ```bash $ composer require laminas-api-tools/api-tools ``` -------------------------------- ### Watch for CSS Changes with Grunt Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/asset/README.md Starts the Grunt watch task to monitor changes in Less files and automatically recompile them for Laminas API Tools. ```shell grunt watch ``` -------------------------------- ### Configure DB-Connected Resources Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/README.md Example configuration for a database-connected service. This specifies parameters like table name, identifier, adapter, hydrator, entity, and collection classes required for database table-driven resource use cases. ```php 'db-connected' => [ /** * This is sample configuration for a DB-connected service. * Each such service requires an adapter, a hydrator, an entity, and a * collection. * * The TableGateway will be called "YourDBConnectedResource\Table" should * you wish to retrieve it manually later. */ 'YourDBConnectedResource' => [ 'table_service' => 'Optional; if present, this service will be used as the table gateway', 'resource_class' => 'Optional; if present, this class will be used as the db-connected resource', 'table_name' => 'Name of DB table to use', 'identifier_name' => 'Optional; identifier field in table; defaults to table_name_id or id', 'adapter_name' => 'Service Name for DB adapter to use', 'hydrator_name' => 'Service Name for Hydrator to use', 'entity_class' => 'Name of entity class to which to hydrate', 'collection_class' => 'Name of collection class which iterates entities; should be a Paginator extension', ], ], ``` -------------------------------- ### Add Laminas API Tools to composer.json Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/README.md Manually specify the Laminas API Tools package and version in the 'require' section of your composer.json file. This ensures the correct version is installed or updated. ```json "require": { "laminas-api-tools/api-tools": "^1.3" } ``` -------------------------------- ### System Configuration for API Tools Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/README.md Required system configuration for Laminas API Tools, enabling database connectivity and defining routing and service manager factories. Includes abstract factories for DB adapter, DbConnectedResource, and TableGateway. ```php namespace Laminas\ApiTools; use Laminas\Db\Adapter\AdapterAbstractServiceFactory as DbAdapterAbstractServiceFactory; use Laminas\ServiceManager\Factory\InvokableFactory; return [ 'asset_manager' => [ 'resolver_configs' => [ 'paths' => [ __DIR__ . '/../asset', ], ], ], 'router' => [ 'routes' => [ 'api-tools' => [ 'type' => 'literal', 'options' => [ 'route' => '/api-tools', ], 'may_terminate' => false, ], ], ], 'service_manager' => [ 'factories' => [ MvcAuth\UnauthenticatedListener::class => InvokableFactory::class, MvcAuth\UnauthorizedListener::class => InvokableFactory::class, ], 'abstract_factories' => [ DbAdapterAbstractServiceFactory::class, // so that db-connected works "out-of-the-box" DbConnectedResourceAbstractFactory::class, TableGatewayAbstractFactory::class, ], ], ]; ``` -------------------------------- ### Enable Laminas API Tools Module in Application Configuration Source: https://github.com/laminas-api-tools/api-tools/blob/1.8.x/README.md Integrates the Laminas API Tools module into your Laminas application by adding its name to the 'modules' array in the application's configuration file. ```php return [ /* ... */ 'modules' => [ /* ... */ 'Laminas\ApiTools', ], /* ... */ ]; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.