PHPackages                             api-code/base-symfony - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. api-code/base-symfony

ActiveProject[API Development](/categories/api)

api-code/base-symfony
=====================

API forked of api-platform/api-platform

v1.0.2(9y ago)220MITPHPPHP &gt;=7.0

Since Jun 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jairoFg12/API_BASE_SYMFONY)[ Packagist](https://packagist.org/packages/api-code/base-symfony)[ Docs](https://codefull.xyz)[ RSS](/packages/api-code-base-symfony/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (29)Versions (3)Used By (0)

API BASE SYMFONY
================

[](#api-base-symfony)

```
  composer create-project api-code/base-symfony YOUR_FOLDER -s dev
```

This is a fork of [https://api-platform.com/](https://api-platform.com/ "API platform"). Is for personal use, and including

- Configuration basic of api platform
- Integrate a JWT
- Doctrine migrations, fixtures and extensions.
- JMose scheduler for cron jobs
- Email with spool command!

Remember, is for PHP &gt;= 7.0

BEGIN
-----

[](#begin)

```
bin/console doctrine:database:create
bin/console doctrine:schema:create
 # or the best way for databse, use migrations!!
bin/console doctrine:migrations
                  :diff     Generate a migration by comparing your current database to your mapping information.
                  :execute  Execute a single migration version up or down manually.
                  :generate Generate a blank migration class.
                  :migrate  Execute a migration to a specified version or the latest available version.
                  :status   View the status of a set of migrations.
                  :version  Manually add and delete migration versions from the version table.

bin/console assets:install
bin/console fos:user:create  # Important for a Token!
bin/console server:start

# For Jmose scheduler
bin/console scheduler:execute

# Email with spool, program a scheduler with this strategy
bin/console swiftmailer:spool:clear-failures
```

Cambiar llaves de JWT
---------------------

[](#cambiar-llaves-de-jwt)

```
$ mkdir -p var/jwt # For Symfony3+, no need of the -p option
$ openssl genrsa -out var/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in var/jwt/private.pem -out var/jwt/public.pem
```

Obtain a token
--------------

[](#obtain-a-token)

We use [https://github.com/lexik/LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle "JWT!")

```
curl -X POST http://localhost:8000/api/login_check -d _username=johndoe -d _password=test
```

Header
------

[](#header)

In each request add this header Authorization: Bearer tokenJWT

Add more controllers
--------------------

[](#add-more-controllers)

##### First option

[](#first-option)

Routes with yml in app/config/routing.yml

```
# app/config/routing.yml
book_special:
    path: '/productsjairo/{id}/special'
    methods:  ['GET']
    defaults:
        _controller: 'AppBundle:Products:special'
        _api_resource_class: 'AppBundle\Entity\Product'
        _api_item_operation_name: 'special'
```

##### Second option

[](#second-option)

Router with annotations in each action of a controller

```
# In a controller
 /**
     * Example with annotations
     * @Route(
     *     name="demo_special",
     *     path="/demo/{id}/special",
     *     defaults={"_api_resource_class"=Product::class, "_api_item_operation_name"="specialdemo"}
     * )
     * @Method("GET")
     */
    public function demoAction()
    {
        $em = $this->getDoctrine()->getManager();
        $products = $em->getRepository(Product::class)->findAll();
        return $products;
    }
```

Subscribe events for modify request
-----------------------------------

[](#subscribe-events-for-modify-request)

In src/AppBundle/EventSubscriber add a file name ProductMailSubscriber.php

```
 [['sendMail', EventPriorities::POST_WRITE]],
            KernelEvents::VIEW => [['accionDemo', EventPriorities::POST_WRITE]]
        ];
    }
```

For more events

Add custom filter
-----------------

[](#add-custom-filter)

```
>>Add filter regexp
 * @ORM\Table(name="product")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
 */
class Product
{
```

Now in the url you can:

```
../api/products?id=[1,2]&number=20&description=otr
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3301d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/637d283b6802c1d0350c953219cfdbde1720f84b5917873be721c0b75fc91b37?d=identicon)[jairog12](/maintainers/jairog12)

---

Top Contributors

[![jairoFernandez](https://avatars.githubusercontent.com/u/3932407?v=4)](https://github.com/jairoFernandez "jairoFernandez (23 commits)")

###  Code Quality

TestsBehat

### Embed Badge

![Health badge](/badges/api-code-base-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/api-code-base-symfony/health.svg)](https://phpackages.com/packages/api-code-base-symfony)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M724](/packages/sylius-sylius)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M497](/packages/pimcore-pimcore)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k59](/packages/open-dxp-opendxp)[oro/platform

Business Application Platform (BAP)

645143.5k114](/packages/oro-platform)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
