2017 © Pedro Peláez
 

project symfony_traditional_login

image

thiagogomesverissimo/symfony_traditional_login

  • Wednesday, July 4, 2018
  • by thiagogomesverissimo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Symfony 4 Traditional Login Form with users from database (migrations available to mysql)

This project is an basic implementation of traditional login form with users from database on symfony, as described in the https://symfony.com/doc/current/security/form_login_setup.html and some codes from symfony demo, (*1)

Symfony 4 Traditional Login Form with users from database (migrations available to mysql), (*2)

Included:, (*3)

  • login and logout routes configured
  • web crud and commands to manage users in database
  • passwords encoded with bcrypt

Not Included:, (*4)

  • Registration to anonymous
  • Area to user to change the own password

The main reason for this project is to be a start point to another projects thet depends of local users to work., (*5)

Deploy

Download lastest release:, (*6)

composer create-project thiagogomesverissimo/symfony_traditional_login 

Download branch master:, (*7)

composer create-project thiagogomesverissimo/symfony_traditional_login -s dev

Configure .env variables and run migrations (only for mysql users):, (*8)

php bin/console doctrine:migrations:migrate

Up server:, (*9)

php bin/console server:run

Three suggestions to create users on database:

1. To use data fixtures that create two users: admin and user, same for passwords:

 php bin/console doctrine:fixtures:load

2. To use command:

php bin/console app:add-user user user123
php bin/console app:add-user admin admin123 --admin
php bin/console app:list-users
php bin/console app:delete-user admin
php bin/console app:delete-user user

3. For learning purposes, you can use psysh:

bin/console psysh
$em = $container->get('doctrine')->getManager()
$admin = new App\Entity\User
$admin->setUsername('admin')
$password = $container->get('security.password_encoder')->encodePassword($admin, 'admin')
$admin->setPassword($password)
$em->persist($admin)
$em->flush()

The Versions