Getting Started

This is the official documentation of the forestadmin/laravel-forestadmin v2+ and forestadmin/symfony-forestadmin PHP agents.

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.

What can I connect to?

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)

Example

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 updated