PHP code example of sociolink / api-resource-bundle

1. Go to this page and download the library: Download sociolink/api-resource-bundle 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/ */

    

sociolink / api-resource-bundle example snippets


return [
    // ...
    SocioLink\ApiResourceBundle\ApiResourceBundle::class => ['dev' => true, 'test' => true],
];
bash
# Menu interactif (terminal requis) : entités regroupées par namespace, « All » en dernier
php bin/console generate:resource

# Une entité précise — nom court ou FQCN
php bin/console generate:resource Article
php bin/console generate:resource 'App\Entity\Blog\Article'

# Toutes les entités, sans menu (CI, --no-interaction)
php bin/console generate:resource '*' --force

# Écraser les fichiers existants
php bin/console generate:resource Article --force

# Aperçu sans écriture
php bin/console generate:resource Article --preview

src/
├── DTO/
│   └── Article/
│       ├── ArticleCreateDto.php
│       └── ArticleUpdateDto.php
└── State/
    └── Article/
        ├── ArticleCreateProcessor.php
        └── ArticleUpdateProcessor.php

tests/
└── Functional/
    └── Article/
        └── ArticleApiTest.php        (si --with-tests)