PHP code example of conceptte / testcrm

1. Go to this page and download the library: Download conceptte/testcrm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

conceptte / testcrm example snippets


$router->add(\Mtr\MiniCRM\Routing\RouterFactory::create());

public function loadConfiguration(): void
{        
    $this->extConfig = $this->loadFromFile(__DIR__ . '/../config/minicrm.php') ?? [];
}

$mapiv1 = 'minicrm.api.v1';

return [
    'minicrm' => [
        'mapping' => [
            'MiniCRM' => 'Mtr\MiniCRM\Presentation\*\*Presenter',
            'MiniCRMAPIV1' => 'Mtr\MiniCRM\API\V1\Presentation\*\*Presenter',
        ],
        'services' => [
            'paginator' => Paginator::class,
            'paginationControl' => PaginationControl::class,
            'customersRepository' =>[
                'type' => CustomersRepositoryInterface::class,
                'create' => CustomersRepository::class,
            ],
            'activityRepository' => [
                'type' => ActivityRepositoryInterface::class,
                'create' => ActivityRepository::class,
            ],
            'commentsRepository' => [
                'type' => CommentsRepositoryInterface::class,
                'create' => CommentsRepository::class,
            ],

            "{$mapiv1}.request.customers.requestFactory" => CustomersRequestFactory::class,
            "{$mapiv1}.resource.customers.resourceFactory" => CustomerResourceFactory::class,
            "{$mapiv1}.resource.customers.collectionResourceFactory" => CustomerCollectionResourceFactory::class,
            "{$mapiv1}.resource.paginator.resourceFactory" => PaginatorResourceFactory::class,
        ],
    ],
];

public static function create(): RouteList
    {
        $group = new RouteList();

        $minicrm = (new RouteList('MiniCRM'))->add(CustomersRouteFactory::create());
        $api = (new RouteList('MiniCRMAPI'))->add(ApiRouteFactory::create());

        $group
            ->add($minicrm)
            ->add($api);

        return $group;
    }
bash
php vendor/conceptte/minicrm/database/schema.php
#basically it: mysql < vendor/conceptte/minicrm/database/schema.sql
php vendor/conceptte/minicrm/database/seed.php  # optional - adds test data