Getting Started
After doing the quick start, you should have a development project which is up and running and connected to your main data storage system.
However, you can plug as many data sources as you want into the same agent.
Forest Admin collections map to any of those concepts:
- ORM models
- Endpoints on SaaS providers (by writing a custom data source)
- Endpoints on your own API (by writing a custom data source)
In this example, we import collections from Doctrine ORM.
use ForestAdmin\AgentPHP\Agent\Utils\Env;
use ForestAdmin\AgentPHP\DatasourceDoctrine\DoctrineDatasource;
use ForestAdmin\SymfonyForestAdmin\Service\ForestAgent;
return static function (ForestAgent $forestAgent) {
$forestAgent->addDatasource(
new DoctrineDatasource(
$forestAgent->getEntityManager(),
[
'url' => Env::get('DATABASE_URL'),
]
),
)
->build();
};
Last modified 1mo ago