4.09 sur 5
4.09

Guide de développement Web Symfony 4 & 5 : débutant à avancé

Maîtriser le framework PHP Symfony : de la théorie à la création d'une application Real Life avancée en passant par une simple application CRUD
Vous apprendrez Symfony 4 & 5 de la théorie au niveau avancé en créant des projets réels
Vous allez créer deux applications : une simple application crud et un service avancé de partage de vidéos avec intégration PayPal, déploiement sur Heroku, etc.
Vous apprendrez à créer une arborescence de catégories imbriquées à plusieurs niveaux en PHP
Vous apprendrez comment installer Symfony
Vous apprendrez la configuration de Symfony
Vous découvrirez Symfony Flex
Vous découvrirez le workflow de traitement HTTP dans le framework Symfony
Vous apprendrez des itinéraires
Vous apprendrez les contrôleurs
Vous apprendrez les vues dans Symfony en utilisant Twig
Vous apprendrez les formulaires html dans Symfony
Vous apprendrez Doctrine ORM (comment utiliser la base de données)
Vous apprendrez les entités (modèles) dans Symfony et les relations entre elles
Vous en apprendrez plus sur le conteneur de services et les services dans Symfony
Vous apprendrez l'injection de dépendances (autowiring dans Symfony)
Vous apprendrez la commande de la console
Vous apprendrez à créer des événements et des écouteurs
Vous apprendrez à utiliser les sessions et les cookies dans Symfony
Vous apprendrez à envoyer des emails
Vous apprendrez à faire des traductions dans Symfony
Vous découvrirez les concepts de sécurité dans Symfony (connexion, enregistrement, etc.)
Vous apprendrez les tests unitaires et fonctionnels
Vous apprendrez à déboguer des applications Symfony
Vous apprendrez le cache
Vous apprendrez à utiliser Redis pour la session et le cache
Vous en apprendrez plus sur l'héritage des tables de doctrine dans Symfony et les requêtes de bases de données polymorphes
Vous apprendrez à déployer une application Symfony sur Heroku (créer une application en ligne)
Vous apprendrez à intégrer PayPal à l'application Symfony pour effectuer la facturation des abonnements
Vous apprendrez à utiliser l'API externe (Vimeo api) et à l'utiliser avec l'application Symfony
Vous pourrez créer vos propres sites web ou applications web dans le framework Symfony
Vous apprendrez les bases du courtier de messages RabbitMQ
Vous apprendrez les bases de Messenger Component
Vous apprendrez le modèle CQRS - la séparation des responsabilités des requêtes de commande
Vous apprendrez l'API REST avec Symfony & API Platform

Bienvenue dans le meilleur cours de Symfony (y compris les versions 4 et 5) – le formidable framework PHP !

 

Dans ce cours, vous apprendrez Symfony du niveau de base au niveau avancé !

À la fin de ce cours, vous serez capable de créer à la fois des sites Web simples et des applications Web dynamiques complexes dans l’excellent framework Symfony PHP.

 

Cours très pratique ! Presque toutes les sections/concepts sont expliqués à l’aide d’applications/scénarios réels. Dans ce cours, nous allons créer une énorme application de la vie réelle (vous ne trouverez probablement pas de cours où une application plus avancée et nbsp ; comme dans ce cours)

 

Ceci est un guide très complet sur Symfony, qui est l’un des frameworks PHP les plus populaires. La version Symfony 4 a introduit une nouvelle approche des frameworks php – elle commence petit comme un microframework et se développe au fur et à mesure que vous avez besoin de nouvelles fonctionnalités. Vous les installez à l’aide de l’incroyable outil Symfony Flex. Par exemple, si vous créez un site Web simple et que vous n’avez pas besoin d’une fonctionnalité de connexion, aucun code n’est responsable de la connexion au répertoire du framework. Grâce à cela, notre application ne contient que ce dont nous avons vraiment besoin.

;

 

************************************************ **

Le cours se compose de trois parties principales :

1. La partie théorique où j’aborde les concepts de base de Symfony sur des exemples avec des effets sur un navigateur web

2. Dans la deuxième partie, nous allons construire une application simple dans Symfony – une liste de tâches à effectuer (base de données utilisée)

3. Dans la partie 3, nous allons créer une application Web avancée pour l’abonnement vidéo dans laquelle nous intégrons PayPal pour les paiements, les catégories de vidéos imbriquées à plusieurs niveaux, la communication avec l’API Vimeo, le déploiement sur le serveur Heroku

 

ainsi que :

 

Ajout de la section

BONUS (octobre 2019) : principes de base du composant Symfony Messenger, courtier de messages RabbitMQ et CQRS modèle (Command Query Responsibility Segregation) avec un exemple pratique en simulant un système de commerce électronique composé d’une application principale et de microservices coopérants.

 

Mise à jour du cours : (janvier 2020) nouvelle section ajoutée API REST avec Symfony & ; Plate-forme API

************************************************ **

 

 

Pendant le cours, nous couvrirons de nombreux concepts Symfony simples et avancés tels que : le routage, les contrôleurs, les vues, la base de données avec doctrine orm, les entités et les relations entre elles : un à un, un à plusieurs et plusieurs à plusieurs ; événements & auditeurs, sujets de sécurité tels que la connexion, l’enregistrement, l’autorisation ; également les tests unitaires et fonctionnels, l’injection de dépendances, le conteneur de services, les services symfony, l’héritage de table de doctrine avec des requêtes de base de données polymorphes, l’API REST et bien d’autres.

 

Ce cours est une combinaison de théorie et d’approche d’apprentissage basée sur des projets. Apprendre en créant de vrais projets est le meilleur moyen d’apprendre les langages de programmation et les outils comme les frameworks PHP.

 

Toutes les applications du cours ont été réalisées avec Symfony 4 (à l’exception des applications pour la section rest api – Symfony 5). La section Mise à niveau vers Symfony 5 a été ajoutée au cours. Selon la norme Symfony, il n’y a pas de nouvelles fonctionnalités dans Symfony 5.0 par rapport à Symfony 4.4.

 

N’oubliez pas que seule la pratique rend parfait. Si nécessaire, étudiez le cours deux fois ou plus. Prenez des notes  pendant le cours comme un vrai étudiant. Utilisez les documentations, la recherche Google. Enfin, essayez d’écrire l’application vous-même, pas nécessairement la même que dans le cours, vous pouvez essayer de changer, d’ajouter quelque chose, etc. Aucun cours ne fera de vous un très bon développeur web. Cela ne peut que vous rapprocher de cet objectif. Plus on pratique, mieux c’est.

 

———————————————————

CQ

Question :

Vous avez utilisé Symfony 4 et Symfony 5 dans ce cours pour créer des applications pour mettre en pratique vos connaissances. Pourquoi ne pas utiliser uniquement la dernière version ? Cela signifie-t-il que ce cours est obsolète et que je n’en profiterai pas ?

Réponse :

Absolument pas ! Dans des outils comme les frameworks PHP, les fondamentaux et la syntaxe de base ne changent presque jamais, quelle que soit la version. Mais bien sûr, tout logiciel maintenu évolue tout le temps. C’est pourquoi je vous suggère toujours d’utiliser la version du logiciel que l’instructeur utilise dans le cours. Il évite les erreurs et les confusions. En tant que personne qui souhaite apprendre le développement Web, vous devez savoir que le véritable développement Web implique également d’adapter le code aux nouvelles versions si nécessaire – mais ce n’est pas toujours nécessaire, toutes les entreprises ne le font pas. Le logiciel change si souvent que les instructeurs ne seraient pas en mesure de créer les cours pour qu’ils correspondent à la dernière version. Ce n’est même pas conseillé, car en tant qu’étudiant, vous perdriez un aspect important du véritable développement Web – la conscience que tout change et que vous devez être capable de le gérer.

———————————————

 

Inscrivez-vous maintenant et commençons à apprendre Symfony !

Il n’y a aucun risque ! Garantie de remboursement de 30 jours

Introduction

1
Welcome to the course

What this course is all about, what you will learn, how this course is structured, who I am

2
About Symfony

What is Symfony, what it is used for, documentation, release process

3
Tools and requirements for students

What you will need to accomplish the course (tools & requirements for students)

4
How to use the course

Learn how to get the most out of this course

5
Course applications overview

You will get familiar with the applications that we will build in this course

6
Quick note about coding standards

My approach to coding standards and Symfony best practices

7
How to get helped

Symfony 4 & 5 basics, installation & configuration

1
Symfony 4 installation & requirements

Install Symfony 4, check system requirements, take a look at the folder structure

2
Symfony 4 configuration

Main Symfony config file and config folder explained

3
Installing libraries with Symfony Flex

Using Symfony Flex to automate installation of packages. Installing Twig and Doctrine

4
Request & response objects, HTTP processing workflow

Request lifecycle in Symfony

Theory - Symfony 4 & 5 core features

1
Before you start watching this section of the Symfony course

In order to go through this section with ease, install the Symfony app using the version in which an app was created. Later I will show you how to upgrade to the latest stable version of Symfony.

2
Routes

You will know two ways of creating routes in Symfony

3
Controllers

Basics about Symfony controllers

4
Views

Symfony views basics

5
Entities (models)

Create database and use it with entities in Symfony

6
Service container & services - part 1

Service container, autowiring of services

7
Service container & services - part2

Using external service in our own service

8
Advanced routes

Examples of advanced routes in Symfony, optional parameters

9
Flash messages

Using session flash messages in controllers and views

10
Cookies

Using cookies in Symfony (how to get cookie value - see the next lecture)

11
Session

Using session in Symfony

12
POST & GET data

Using POST and GET data in Symfony. Using Request object

13
Custom error pages

Make custom error pages in Symfony

14
Handle exceptions

Handle exceptions in Symfony with example of NotFoundException

15
Binding services to controllers

How to bind a service to a controller so that it can be accessed via php variable in the controller

16
More features in controllers

How to redirect with dynamic parameters, how to download files, how to forward to another controller

17
Views - tags, filters, functions, tests, operators

Explore built-in features in Twig: tags, filters, functions, tests, operators

18
Views - genereate url's and escaping strings

Generate url's for routes and images, escape js, html, css

19
Views - global variables

Make variables global in all Symfony Twig views

20
Views - Webpack Encore

Manage css and js files/libraries with Webpack Encore & npm

21
Views - using app variable

How to access the User, Request, Session and more in Twig via the app variable

22
Views - embed controllers in view

How to render controller results in Twig files

23
Doctrine crud - create

Create a new user and many users using fixtures. Console commands for resetting entire database

24
Doctrine crud - read

Select users from database. Make use of repository

25
Doctrine crud - update

Update a user

26
Doctrine crud - delete

Delete a user from the database

27
Doctrine raw queries

Make raw database queries with Doctrine

28
Doctrine param converter

Use param converter in Symfony to automatically fetch specific object from the database

29
Doctrine LifecycleCallbacks option

Execute entity code automatically using Doctrine events

30
Doctrine one-to-many & many-to-one relationships

One-to-many relationship in Doctrine. Owning and inverse side of a relationship. Bidirectional & unidirectional types of relations. Proxy classes & lazy loading

31
Doctrine database relationships - cascade remove ralated objects

cascade={"remove"} vs onDelete="CASCADE" vs orphanRemoval=true deleting options

32
Doctrine one-to-one relationship

A user has one address and address belongs to only one user

33
Doctrine many-to-many self referencing relationship

How to implement Twitter-like follow user feature in Doctrine

34
Doctrine Query Builder & eager loading

Fetch all related objects with one Doctrine query

35
Doctrine table inheritance mapping in Symfony (polymorphic queries) - part 1

How to design database when entities share common fields

36
Doctrine table inheritance mapping in Symfony (polymorphic queries) - part 2

Create example entities and abstract entity that stores shared properties

37
Doctrine table inheritance mapping in Symfony (polymorphic queries) - part 3

Make polymorhpic queries with lazy and egaer loading options. Single and joined inheritance types

38
Service parameters

Inject parameters to services

39
Service & autowiring by constructor injection and service arguments

Inject other services to a service using constructor injection & service arguments (most common)

40
Service configuration

Autowire, autoconfigure and public configuration options

41
Services - setter injection for optional dependencies

Inject optional dependency to a service using setter method

42
Services - property injection

Inject dependency to a service using class property

43
Install composer package before the next lecture
44
Services - lazy services

How to make a service lazy so that it is instantiated only if we call it

45
Service - aliases

How to use aliases for our services names

46
Service - tags

How to add tags to a service so that it is treated by Symfony in a special way

47
Service - dealing with different implementations of a service

Two services that implement one interface. How to deal with this in our application. Import configuration file to another

48
Services list

List all of services that you can autowire & all services from the Symfony container

49
Cache - basic usage

Basic usage of cache in Symfony. Set cache expiration time

50
Cache - tags

Use cache tags to store/clear related items in/from cache

51
Symfony console

Using Symfony console to automate tasks & get helped

52
Use profiler tool in Symfony

Use profiler tool in Symfony. Take a look at the error stack trace

53
Environments vs kernels

Difference between environments and kernels

54
Deploy Symfony application

Deploy your Symfony application to live server

55
Events & Listeners base concepts

Events & Listeners base concepts in Symfony. List all of Symfony events. Built in Symfony events

56
Create listener

Create listener that listens to the kernel response built in Symfony event

57
Dispatching events

Create an event and dispatch it

58
Create subscriber

Create subscriber and subscribe to custom event & dispatch it

59
Subscriber - many events handled by one subscriber

One subscriber can listen to many events

60
Subscriber - events priorities

Set priorities of subscribed events

61
Form - create a class

Update video entity and create form class for it

62
Form - render in view

Render the form in view file

63
Form - themes

Style your symfony form in easy way

64
Form - send

Send form and save data in the database

65
Form - validation

Validate a form before saving data (backend side validation)

66
Form - events

Use form events to dynamically modify/build forms

67
Form - fields not related to entity

Use "mapped false" option in forms

68
Form - upload files

How to upload files in Symfony application

69
Email - install email package & send an email

Install email package & send emails in Symfony

70
Email - spooling

How to delay the delivery of emails to make loading website faster (send emails using server cron job)

71
Email - functional testing

How to test that an email was sent

72
Security - create user

Create special user for security purposes such as register, login, etc.

73
Security - register

Register a new user

74
Security - login

Login to the application

75
Security - logout

Logout from the application

76
Security - login & remember login state

How to implement 'remember me' feature in the login form

77
Security - csrf

Using csrf token to protect html forms from being hacked

78
Security - use security checker

Install security checker package and check security

79
Install expression-language package
80
Security - authorization using annotations

Use annotations in controllers to authorize user actions

81
Security - authorization using configuration file

Use access control feature in configuration file to restrict access to pages

82
Security - authorization using denyAccessUnlessGranted method

Use denyAccessUnlessGranted method to make authorization in controller method

83
Security - authorization in view files

How to authorize user action in Twig view files

84
Security - authorization using voters

How to use voters to authorize user actions

85
Unit tests - install

Install a package for unit testing, command for running all tests

86
Unit tests - first unit test

Make first unit test in Symfony and test simple calculator service

87
Functional tests - install

Install a package for functional testing, make first functional test

88
Functional & unit tests - common assertions

The most common used assertions while testing

89
Functional tests - click links

How to click links on the website in functional tests

90
Functional tests - send a form

How to send forms in functional tests

91
Functional tests - data providers

Use data providers in functional tests to make test methods simplified

92
Functional tests - tests in isolation

Isolate your tests using second database connection or transactions

93
Tests - mock objects

How to create mocked (fake) objects in testing

94
Tests - code coverage report

Generate code coverage report during testing

95
Translations - install a package

Install and configure a package for translations in Symfony application

96
Translations - views

Make translations in view files

97
Translations - controllers

How to translate in controllers

98
Translations - routes

How to translate routes

99
Translations - pluralization

How to pluralize translated strings

First application in Symfony: to-do list app (CRUD)

1
Before you start watching this section of the Symfony course

In order to go through this section with ease, install the Symfony app using the version in which an app was created. Later I will show you how to upgrade to the latest stable version of Symfony.

2
Installation and creating virtual host (To-Do App)

We will use composer to install Symfony 4 and xampp to work with the framework. We will also make nice url for our application by using virtual hosts in xampp

3
Move html template to Symfony (To-Do App)

We will display our template directly in the Symfony by moving template to it, creating first controller and route

4
Create controller methods (To-Do App)

In this lecture we will create controller methods for 3 actions in our app and use path() function in views to create links to those routes

5
Make entity in Symfony and use it (To-Do App)

We will make connection with the database and create first entity in Symfony 4 to communicate with the database

6
Display list of all tasks on the website (To-Do App)

We will fetch all the records from the database using Doctrine and display it on the website

7
Switch status of a task (To-Do App)

Create method for switching a status of the task: done or undone

8
Delete a task (To-Do App)

Create the method for deleting a task using Doctrine ORM

Controllers, routes, views - install and move html template to Symfony (App)

1
Before you start watching this section of the Symfony course

In order to go through this section with ease, install the Symfony app using the version in which an app was created. Later I will show you how to upgrade to the latest stable version of Symfony.

2
Installation of Symfony 4 framework and moving template to it

Installation of Symfony 4 framework and all the necessary libraries. First steps with moving template to Symfony, installing Twig template engine, extending base layout. Create first route, controller and first page

3
Continue with moving html template to Symfony

Moving admin area pages to Symfony. Use asset() function. Create first twig blocks in views

4
Make template links working in Symfony - part 1

Create routes and controller methods for pages and link them with path() function

5
Make template links working in Symfony - part 2

Create routes and controller methods for pages and link them with path() function

6
Make template links working in Symfony - part 3

Make base Twig layout for admin area. Create routes and controller methods for pages and link them with path() function

7
Make template links working in Symfony - part 4

Create routes and controller methods for pages and link them with path() function

8
Make template links working in Symfony - part 5

Use twig "for" loop etc

9
Install Webpack-Encore

Install & use Webpack-Encore for handling our assets

Doctrine entities, relations, fixtures,console commands - video categories (App)

1
Category entity (model)

Create Category & Video entities. Make first database relations on entities. Create fixtures for Category entity (fake data). Use console commands for handling database related stuff

2
Continue with Category fixtures - part 1

Create subcategories for fixtures

3
Continue with Category fixtures - part 2

Finish creating fixtures for Category entity

4
Display main categories on website

Use Symfony render controller feature. Create advanced route. Use twig filter. Use Doctrine to fetch all main categories (with parent column equals to null)

5
Create custom Twig filter

Create custom Twig filter to slugify url (e.g. change "Romantic Drama" to romantic-drama)

6
Category class for front-end

Create main abstract class for categories and child class for front-end. Install composer packages for debugging code

7
Build php array for nested categories

Create method for building tree array for categories

8
Create nested categories on front-page

Build and display nested html li element for front-page categories. Use "raw" Twig tag

9
Finish displaying categories on front-page

Find main parent of categories, use Twig filters, refactoring of our code

10
Display categories in admin area - part 1

Build html for categories in admin area (html ul li). Update Category entity to allow for deleting a category. Controller method for deleting category

11
Display categories in admin area - part 2

Build html for categories in admin area (html option list). Use php recursive method. Render controller result in Twig file

12
Edit category in admin panel - part 1

Controller method for editing category, render controller in view

13
Edit category in admin panel - part 2

Create html form in Symfony. Modify controller method to handle POST requests. Build html form in view with Symfony approach. Form validation

14
Edit category in admin panel - part 3

Validate form

15
Edit category in admin panel - part 4

Save category in database. Unique key for name field in category table

16
Edit category in admin panel - part 5

Code refactoring

First unit tests, mocking classes (Symfony App)

1
Unit testing of categories - part 1

Unit test slugger for url's. Sh script to automate tasks

2
Unit testing of categories - part 2

Mocking category class

3
Unit testing of categories - part 3

Build 3 mocked classes: two for admin area and one for front-end

4
Unit testing of categories - part 4

Testing admin option list (html)

5
Unit testing of categories - part 5

Testing admin "ul li" list (html)

First functional tests with isolation (Symfony App)

1
Functional testing of categories - part 1

Installing necessary dependencies. Create first functional test

2
Functional testing of categories - part 2

Configure database transactions (testing with isolation)

3
Functional testing of categories - part 3

Test editing category

4
Functional testing of categories - part 4

Test deleting category

Paginate, sort and search - videos on the website and test it (Symfony App)

1
Create video fixtures

Create video fixtures (fake video data to display on website)

2
Videos on front-page

Display videos on front-page taken from the database

3
Pagination

Paginate list of videos

4
Display videos from child categories

Build recursive function to get id's of child categories and display videos from them

5
Sort videos

Sort videos by title using Doctrine Query Builder

6
Search results

Search videos by title in the database and display them

7
Functional testing of videos - part 1

Test no results on the website

8
Functional testing of videos - part 2

Test results were found on the website

9
Functional testing of videos - part 3

Test sorting

Login and authorization system, sample user data - fixtures (Symfony App)

1
Symfony login system - part 1

Make user entity. Install security package with Symfony Flex

2
Symfony login system - part 2

Make user fixtures (example user data in the database)

3
Symfony login system - part 3

Make changes in configuration file for login functionality

4
Symfony login system - part 4

Modify controller methods and views

5
User roles - part 1

Display roles restricted stuff and data of currently logged in user

6
User roles - part 2

Prevent access user to content based on user roles

7
User roles - part 3

Prevent access user to content based on user roles - part 2

8
Display links for users depending on login status - part 1

Display links for users depending on login status

9
Display links for users depending on login status - part 2

Display links for users depending on login status

10
Securing access to superadmin pages

Securing access to superadmin pages

11
Check security

Install package for checking security of our application

Html forms, register new users (Symfony App)

1
User registration - part 1

Build html form element for User entity

2
User registration - part 2

Create register controller method and html form

3
User registration - part 3

Encode user password and login user automatically after registration

Other functional tests (Symfony App)

1
Functional testing of categories - part 1

Test delete and edit category

2
Functional testing of categories - part 2

Test categories. Change login method for testing purposes to http_basic

3
Functional testing - accessing url's - part 1

Test access to secured url's

4
Functional testing - accessing url's - part 2

Test access to secured url's

Doctrine and LifecycleCallbacks, repositories - comments on videos (Symfony App)

1
Comments functionality

Create Comment entity, enable LifecycleCallbacks

2
Comment fixtures

Create comment fixtures (fakes data) and implement dependent fixtures interface (first user data must load and then comment fixtures)

3
Dynamic value of comments number

Display dynamic value of number of comments and video placeholder for not logged in users

4
Display video details

Controller method for displaying video details. Using repository and doctrine query builder to load video with dependent entities

5
Display comment details

Display comment details, install knp-time-bundle

6
Create new comment

Create controller method and html form

7
Functional testing

Code refactoring. Install package for testing with isolation using database rollback feature

8
Functional testing of comments

Test add new comment

Many-to-many Doctrine relation - likes/dislikes functionality (Symfony App)

1
Video entity

Create video entity and many-to-many relations (like functionality)

2
Fixtures for videos

Create fixtures for videos including like and dislikes of videos

3
Display likes/dislikes - part 1

Prepare for likes/dislikes functionality on the website

4
Display likes/dislikes - part 2

Prepare javascript for likes, compile it with Webpack encore

5
Display likes/dislikes - part 3

Prepare controller method

6
Display likes/dislikes - part 4

Prepare controller method for like and dislike

7
Sort by likes - part 1

Sort by likes using Doctrine query builder

8
Sort by likes - part 2

Sort by likes using Doctrine query builder

9
Improve searching

Improve searching

10
List videos in admin panel

List videos in admin panel depending on who is logged in - an administrator or a regular user

11
Improve functional testing

Create two php traits for testing purposes (role admin and role user traits)

12
Functional testing of likes - part 1

Test like video

13
Functional testing of likes - part 2

Test dislike video

14
Functional testing of likes - part 3

Testing proper number of likes

15
Code refactoring - part 1

Move likes code from frontcontroller to trait and login code to new controller

16
Code refactoring - part 2

Create new controllers for admin area and move code to them

Doctrine database relations & Redis for session - video subscriptions (App)

1
Subscription functionality - part 1

Make Subscription entity and relate it with User entity

2
Subscription functionality - part 2

Make subscription fixtures

3
Admin profile

Update admin profile - show cancel plan link to a regular user

4
Create video placeholder functionality

Display a video placeholder for users that do not have valid subscription

5
Code refactoring

Create dynamic values for plan names instead of hardcoding it. Create new controller for subscriptions

6
Install Redis

Install and configure Redis as service (for session storage)

Register new users with choosing video subscription plan (Symfony App)

1
Register with proper subscription plan - part 1

Register with proper subscription plan

2
Register with proper subscription plan - part 2

Register with proper subscription plan

3
Register with proper subscription plan - part 3

Create php code responsible for saving subscription to registered user

4
Register with proper subscription plan - part 4

Register users using saveSubscriptionPlan trait

5
Enable cascade deletion of videos and comments

Enable cascade deletion of videos and comments that belong to deleted user

6
Functional testing of subscription

Functional testing of subscription

Flash messages, update user profile using Doctrine (Symfony App)

1
Delete admin profile

Delete admin profile

2
Update admin profile - part 1

Build Symfony html form and update admin profile

3
Update admin profile - part 2

Add vimeoapikey html field to superadmin profile

4
Update admin profile - part 3

Use Symfony flash messages to show errors when form data are invalid

5
Update admin profile - part 4

Save user data using Doctrine. Encode user password

6
Functional testing of user account

Test if a user can delete his account and change password

7
Superadmin profile

Superadmin can display and delete all users

8
Functional test

Test if superadmin can delete users

Upload files - two implementations of uploader interface (Symfony App)

1
Upload video - part 1

Create a form for uploading videos locally and test access to uploading route

2
Upload video - part 2

Create uploader interface and uploader class for local uploading. Configure uploader service

3
Upload video - part 3

Create global variable to differentiate route name depending on environment

4
Delete videos

Superadmin can delete videos

5
Categories select list in admin panel

Code refactoring and display categories select list in admin panel. Update video category

6
Change video for no members

Change video for no members

7
Remove novalidate attribute from html forms

Remove novalidate attribute from html forms

8
Upload videos to Vimeo

Create uploader service, controller method. Configure uploader service

9
Set duration for uploaded video

Set duration for uploaded video to Vimeo video service (by authenticated ajax call to Vimeo API)

10
Delete a comment

Delete a comment and secure this by authorization (a user is allowed to delete only his own comment)

Events & listeners, sending emails (Symfony App)

1
Create listener in Symfony

Create listener that listens to the adding new video event

2
Send email on the event of adding a new video

Send email when adding new video, email spooling

3
Functional testing

Test admin can delete a video

Translations to other languages (Symfony App)

1
Translations - part 1

Translate website to other languages, update route names

2
Translations - part 2

Translate text in view files, functional tests

Caching pages, services & event subscribers (Symfony App)

1
Cache - part 1

Install cache package, implement two cache services and configure it in Symfony

2
Cache - part 2

Cache video list on the website

3
Cache - part 3

Clear cache before and after each functional test

4
Cache - part 4

Clear cache after admin changes data on the website (by creating event subscriber)

5
Cache - part 5

Cache functional testing

Different enviromnents - Heroku deployment (Symfony App)

1
Before you start watching this section of the Symfony course

Files caching mechanism do not work on Heroku free account, so we need to customize our code to prevent some unexpected behavior.

2
Heroku deployment - part 1

Prepare for Heroku deployment, create configuration files, update composer.json file, create database

3
Heroku deployment - part 2

Deploy video subscription application on Heroku

Symfony services by PayPal integration (Symfony App)

1
Attention!

Be aware of constantly changing PayPal look and feel

2
PayPal integration - part 1

Create PayPal service and subscription buttons

3
PayPal integration - part 2

Handle paypal verify url

REST API with Symfony & API Platform

1
Introduction

What we will learn and build in this section of the Symfony course

2
Install Symfony 5 and EasyAdmin bundle

EasyAdmin bundle will alternatively serve as an admin component for our API Platform app. Using EasyAdmin bundle you can create an admin panel for your Symfony application in a minute!

3
Install API Platform. Create entities using Schema Generator component of API Pl

Use schema.org service to create entities with property names recognizable by most popular search engines

4
Customize EasyAdmin bundle

Enable editing entities through EasyAdmin

5
Upload images through EasyAdmin

Install a package for uploading images through EasyAdmin bundle

6
Create related entities to manage through EasyAdmin

Update Product and Offer entities. One to many relation on entities

7
Authentication and authorization to EasyAdmin app

Generate scafoold files for security purposes with just one console command. Ok, we have just created a backend for saving data to be consumed by our API

8
Create client JavaScript app to consume restAPI Platform app. GET API endpoint

We will build client app to consume api using pure JavaScript

9
Create pagination

With API Platform creating pagination links is a breeze

10
Create a simple router

Create a simple router to manage different routes in our js app

11
Sort api query result using API Platform order filter

We will sort list of products by name

12
Use exists filter of API Platform

Show only those products who have images

13
Use search filter of API Platform

Make api call to find products by its name

14
API Platform serialization groups (normalization and denormalization)

Allow to fetch related objects (offers for a product) together with parent object

15
Test structured json-ld data with Google tools

Check if our json-ld results are recognizable by Google search engine

16
The second javascript app to consume api. GET api request, disable pagination

The first api consumer app was just a frontend. Now let's create backend consumer api app

17
Add an offer. POST rest api request

Add an offer to the product using API Platform POST request

18
Delete an offer. DELETE rest api request

Delete an offer from the product using API Platform DELETE request ("item operation")

19
Install & configure JWT authentication package

Enable token based authentication and authorization to our API Platform application

20
Register a new user

Make POST api call to register a new user

21
Login to application

Login by getting and sending JWT token to backend. Test if token is valid with Postman

22
Create offers database relation for users, authorization

Authorize users to delete only his offer

23
Using API Platform event subscriber

Save user data for his offer using event subscriber

24
API Platform subresources (nested endpoints)

Prepare for fetching only offers belonging to logged in user using API Platform subresource feature

25
Create listener class to produce additional data to the JWT response - user id

We will need user id to get only his offers

26
Refactoring: make easier authorization. Use JavaScript Promises

Call sending JWT token header only in one place

27
Handle 401 error status code when invalid JWT token

Handle token expired, incorrect or missing

28
Login automatically when invalid token

If JWT token is not correct and we want to make login protected actions, send token automatically. Use JavaScript Promises

29
Lost password functionality - part 1

Create LostPassword Symfony entity

30
Lost password functionality - part 2

Prepare LostPassword entity to be valid as a API Platform resource, "colletion operations". Create controller to handle request for new password

31
Lost password functionality - part 3

Use POST api request to send the token to the user that wants to change his password

32
Lost password functionality - part 4

Create ResetPasswordRequestEvent event and dispatch (fire) it when sending reset password request

33
Lost password functionality - part 5

Create ResetPasswordRequestListener listener to send email for changing the user's password

34
Lost password functionality - part 6

Custom API Platform operation - prepare final request to change user's password (modify User entity and create a controller to handle the operation)

35
Lost password functionality - part 7

PATCH API Platform request - update users table with a new  password. Patch request updates a record (like PUT request), but only specific columns choosen. PUT request replaces entire record

36
Upload a file through REST API - part 1

Create JavaScript class to handle REST API file upload

37
Upload a file through REST API - part 2

Create UploadFileController as the backend handler for uploading files

38
Upload a file through REST API - part 3

Make final post api request to upload a file

39
Validation and errors handling

Using validation groups on operations. Convert Symfony PHP exceptions to HTTP errors

40
Testing API with PhpUnit

Write and run functional tests for your API

41
Fix GetOffers authorization

Getting offers is allowed only by users logged in to the application

42
API Platform Cache

Use Symfony Reverse Proxy built-in feature and http headers to cache rest api results

43
Deploy API Platform app to Heroku

Deploy our three apps to Heroku: API Platform app, client frontend app and client backend app

44
Fix "can not be converted to string" error

While testing our apps we can see some errors. Fix them!

45
Final thoughts

Make sure you thoroughly tested your API Platform app before exposing it to production!

BONUS section: RabbitMQ & CQRS with Symfony Messenger

1
Before you start watching this section of the Symfony course

In order to go through this section with ease, install the Symfony app using the version in which an app was created. Later I will show you how to upgrade to the latest stable version of Symfony.

2
Symfony Messenger Component - introduction

What we can do with Symfony Messenger Component

3
RabbitMQ basics

What is RabbitMQ, what it is used for. RabbitMQ Exchange types

4
CQRS - introduction

Command Query Responsibility Segregation pattern - when it is useful

5
Time for practice: simulate e-commerce system using Messages

Mix Symfony Messenger, RabbitMQ, CQRS together and build something amazing!

6
Install first Symfony app

Install first Symfony app: e-shop website (simulation)

7
Create a controller for e-shop website

Inside a controller make three basic requests that we want to simulate in our messaging system

8
Install Symfony Messenger Component & use it

Install Symfony Messenger Component, configure it. Use component to dispatch query message

9
Dispatch CreadeOrder message

Create command message for ordering shop products and dispatch it via message bus

10
Dispatch SignUpSms message

Create command message for signing up to sms service and dispatch it via message bus

11
Route messages to Doctrine transport

Route SignUpSMS and Order messages to Doctrine transport - make processes asynchronous. Consume the messages

12
Install RabbitMQ

RabbitMQ installation on Linux Ubuntu

13
Create Symfony microservice and send messages to it

We will send OrderProducts message to warehouse database service using Fanout Exchange of RabbitMQ. Make use of Worker

14
Create another Symfony microservice and send messages to it

We will send OrderProducts message to email service using Fanout Exchange of RabbitMQ. Make use of Worker

15
Create two another Symfony microservices and send messages to them

We will send Sms message to sms service using Direct Exchange of RabbitMQ. Make use of Worker

16
Where to go from here

What you need to remember about if you plan to deploy your Messenger app to production and expose it to clients

Upgrade guide

1
Upgrade Symfony from >=4.0 version
2
New features in the next major Symfony release (5)
Vous pouvez afficher et ru00e9viser les supports de cours indu00e9finiment, comme une chau00eene u00e0 la demande.
Absolumentu00a0! Si vous disposez d'une connexion Internet, les cours sur WeCours sont disponibles u00e0 tout moment sur n'importe quel appareil. Si vous n'avez pas de connexion Internet, certains instructeurs permettent u00e9galement u00e0 leurs u00e9tudiants de tu00e9lu00e9charger les cours. instructeur, alors assurez-vous d'u00eatre du bon cu00f4tu00e9u00a0!
4.1
4.1 sur 5
Notes987

Détails des Notes

Étoiles 5
414
Étoiles 4
336
Étoiles 3
130
Étoiles 2
41
Étoiles 1
25
Suivre un cours
Garantie de remboursement de 30 jours

Inclut

24 heures de vidéo à la demande
Accès complet à vie
Accès sur le mobile et la télévision
Certificat d'achèvement

Archive

Working hours

Monday 9:30 am - 6.00 pm
Tuesday 9:30 am - 6.00 pm
Wednesday 9:30 am - 6.00 pm
Thursday 9:30 am - 6.00 pm
Friday 9:30 am - 5.00 pm
Saturday Closed
Sunday Closed