Generated from template https://github.com/dunglas/symfony-docker
- If not already done, install Docker Compose (v2.10+)
- Run
docker compose build --pull --no-cache
to build fresh images make start
make sh
to enter php containerphp bin/console lexik:jwt:generate-keypair
- Open
https://localhost
in your favorite web browser and accept the auto-generated TLS certificate - Run
docker compose down --remove-orphans
to stop the Docker containers.
make sh
(if you're not in the php container allready)
php bin/console doctrine:database:create
php bin/console doctrine:schema:update --force
POST https://localhost/api/register
{
"email": "john@email.com",
"password": "B2#Etw8BN3zi"
}
POST https://localhost/api/login_check
{
"email": "john@email.com",
"password": "B2#Etw8BN3zi"
}
Summary of Association Override, Attribute Override, Mapped Superclasses
EntityA EntityB Example using InheritanceType
in mode SINGLE_TABLE
PR related: #1
EntityX EntityY EntityZ Example using MappedSuperclass
on abstract class
classDiagram
EntityX --> EntityY
EntityX --> EntityZ
class EntityX ~abstract~
EntityX : +User author
EntityX : +string name
class EntityY
EntityY : +string recipient
class EntityZ
EntityZ : +Collection recipients
Example of
MappedSuperclass
and Get Collection of EntityY and EntityZ on same GetCollection- Automatically applies the author with the Interface
AuthorInterface.php
and the SubscriberAttachAuthorSubscriber
PR related: #2
Mail MailIncoming MailOutcoming of π InheritanceType
in mode JOINED
classDiagram
Mail --> MailIncoming
Mail --> MailOutcoming
class Mail
Mail : +User author
Mail : +string subject
class MailIncoming
MailIncoming : +string sender
MailIncoming : +Collection recipients
class MailOutcoming
MailOutcoming : +User sender
MailOutcoming : +string recipient
PR related: #3
curl -X 'GET' \
'https://localhost/api/users?page=1' \
-H 'accept: text/dino'
curl -X 'GET' \
'https://localhost/api/users?page=1' \
-H 'accept: text/csv'
PR related: #4
"hydra:description": "Unable to generate an IRI for the item of type \"App\\Entity\\EntityB\""
This was happening because the entity was never being saved, so the id was never generated.
https://stackoverflow.com/questions/57887026/unable-to-generate-an-iri-for-the-item-of-type-exception-after-api-platform-mi
UniqueEntity('email')
php bin/console hautelook:fixtures:load
POST https://localhost/api/entity_bs
- fork from dunglas/symfony-docker
- install doctrine, api-platform, fixtures
composer require symfony/orm-pack
composer require --dev symfony/maker-bundle
-
Creation Book entity + fixtures
- filter on
category[]
- filter on
-
Install Lexik JWT
composer require "lexik/jwt-authentication-bundle"
php bin/console lexik:jwt:generate-keypair
POST /api/discussions
{
"content": "Fuga ducimus debitis fuga quis sint similique dolores."
}
POST /api/discussions/{id}/message
{
"content": "Hic ut et excepturi molestias amet sit."
}
-
mail confirmation
-
resend mail confirmation (expiration date)
-
password forgot
-
change password forgot
-
update mail (resend confirmation mail + expiration date)
-
update password (need current password)
- multipart
- enum instead array in Book $category
- hydrate the results by iri
- paginate results
- order results
- filter results