Download the PHP package plume-solution/user-bundle without Composer
On this page you can find all versions of the php package plume-solution/user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plume-solution/user-bundle
More information about plume-solution/user-bundle
Files in plume-solution/user-bundle
Package user-bundle
Short Description A new bundle for easy user management
License MIT
Informations about the package user-bundle
user-bundle
A new simple bundle for easy user management
Instalation
Before all, make sure you have php 7.4 or 8.0 and Symfony 4.4 or 5.x (kernel 5.1.5 for security issue with 5.x version).
You can easily install this with composer like:
composer require plume-solution/user-bundle
Usage
User entity
Create an entity (or use existent) that extend PlumeSolution\UserBundle\Models\BaseUser
.
After that, you can choice a Trait for adding some basic field to your user.
Disposable Trait:
- EmailAndNicknamePasswordTrait : Support user that have Email and username (called nickname)
- EmailPasswordTrait : For user that log without nickname (the username is the email, you can add the NicknameTrait for add a nickname not used in login system.).
- NicknamePasswordTrait : For user that log with username and without usage of email.
For the login usage, see the Login section.
Probably more features in the future :smile:
User Manipulation
For user manipulation, you can use the PlumeSolution\UserBundle\Manager\UserManager
Service.
Is auto-wire, just inject in Controller action or service constructor.
After is injected, you can consult PHP Doc for usage (so basic :smile: ).
User Login
The bundle provides a controller you can 'extends' in your app code
Just create a class that use the PlumeSolution\UserBundle\Controllers
.
The controller is built with override in mind, you have multiple internal action you can customize :
__invoke(Request $request)
: This method is the action called by Router, you have to override with parent call for usage of annotation.redirectIfAlreadyLogged()
: This is used for redirect user on a route if already fully authenticated.getLoginForm()
: Used to build the LoginForm, by default it usePlumeSolution\UserBundle\Form\LoginType
with the minimum for a login.renderTemplate(FormInterface $form)
: Used for render template with form.
User Login Configuration
use this example for security.yaml and adapt if you need :
Support
Thanks for using our job ! :smile:
Don't hesitate to open issue or PR if you want to contribute with code and/or idea !
All versions of user-bundle with dependencies
symfony/security-bundle Version ^4.4 | ^5.0
doctrine/doctrine-bundle Version ^2.0
symfony/framework-bundle Version >=4.4
symfony/form Version ^4.4 | ^5.0