uni-method / symfony-bundle
Jsonapi symfony implementation bundle
Installs: 58
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.4
- ext-json: *
- doctrine/annotations: >=1.12
- doctrine/orm: ^2.8|^3.0
- symfony/config: ^4.4|^5.0|^6.0
- symfony/dependency-injection: ^4.4|^5.0|^6.0
- symfony/http-kernel: ^4.4|^5.0|^6.0
- symfony/validator: ^5.2|^6.0
- symfony/yaml: ^4.4|^5.0|^6.0
- uni-method/jsonapi-mapper: ^0.2.7
Requires (Dev)
- roave/security-advisories: dev-master
- symfony/framework-bundle: ^4.4|^5.0|^6.0
- symfony/phpunit-bridge: ^4.4|^5.0|^6.0
Conflicts
- twig/twig: <1.41|<2.10
This package is auto-updated.
Last update: 2024-11-28 03:25:04 UTC
README
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
$ composer require uni-method/symfony-bundle
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require uni-method/symfony-bundle
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... UniMethod\Bundle\UniMethodBundle::class => ['all' => true], ];
Step 3: Bundle options
Create if not exist config/packages/uni_method.yaml
uni_method: default_path: '%kernel.project_dir%/config/jsonapi' # path to entities config prefix: 'v' # prefix for version forexample /v1/user/ available: # all available versions - 1 # version (subfolder in default_path)
Step 4: Create first version (v1)
# config/jsonapi/1/config.yml entities: user: class: 'App\Entity\User' description: 'Just a user' attributes: id: getter: 'getId()' type: integer email: getter: 'getEmail()' type: string paths: - item: user method: list
Step 5: Enable Bundle routing
# config/routes.yaml app_extra: resource: . type: extra