kematjaya / user-bundle
7.0-BETA
2026-01-06 04:11 UTC
Requires
- doctrine/common: ^2.0|^3.0
- doctrine/doctrine-bundle: ^2.3
- doctrine/orm: ^2.8
- gregwar/captcha-bundle: ^2.1
- symfony/doctrine-bridge: ^7.4
- symfony/form: ^7.4
- symfony/framework-bundle: ^7.4
- symfony/http-foundation: ^7.4
- symfony/routing: ^7.4
- symfony/security-bundle: ^7.4
- symfony/security-core: ^7.4
- symfony/twig-bundle: ^7.4
- symfony/uid: ^7.4
- symfony/yaml: ^7.4
Requires (Dev)
- doctrine/doctrine-fixtures-bundle: ^3.3
- phpunit/phpunit: ^9.0
- symfony/browser-kit: ^7.4
- symfony/phpunit-bridge: ^8.0
- symfony/var-dumper: ^7.4
This package is auto-updated.
Last update: 2026-06-06 05:06:55 UTC
README
- Install
composer require kematjaya/user-bundle - Enable Bundle
add to config/bundles.php
Kematjaya\User\KmjUserBundle::class => ['all' => true] - create file config/packages/kmj_user.yml
user: route: login: kmj_user_login login_success: ## ----- default redirect page ---- default: dashboard_index ## ----- if multiple redirect ---- roles: - { role: ROLE_USER, path: homepage } - { role: ROLE_SUPER_USER, path: backend_dashboard } - update config/packages/security.yml
security: role_hierarchy: # kmj_user default rule is (ROLE_SUPER_USER, ROLE_ADMINISTRATOR, ROLE_USER) ROLE_ADMINISTRATOR: ROLE_USER ROLE_SUPER_USER: ROLE_ADMINISTRATOR password_hashers: Kematjaya\UserBundle\Entity\KmjUser: auto enable_authenticator_manager: true providers: app_user_provider: entity: class: Kematjaya\UserBundle\Entity\KmjUser property: username firewalls: main: logout: path: kmj_user_logout custom_authenticators: - Kematjaya\UserBundle\Security\FormLoginAuthenticator - import route, update file config/routes/annotations.yaml
kmj_user: resource: '@UserBundle/Resources/config/routing/all.xml' - create entity
// src/Entity/MyUser.php .. use Kematjaya\UserBundle\Entity\DefaultUser; ... class MyUser extends DefaultUser { /** * @ORM\Column(type="string", length=255, nullable=true) */ private $email; public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): self { $this->email = $email; return $this; } } - update schema:
php bin/console doctrine:schema:update --force - for insert demo user, then run on command :
then, use root and admin for login and password: admin123php bin/console doctrine:fixtures:load - other route :
{{ path('kmj_user_user') }} {{ path('kmj_user_profile') }} // for profile user {{ path('kmj_user_change_password') }} // for open change password form {{ path('kmj_user_logout') }} // for logout
10, password form theme:
twig: form_themes: ## .... for bootstrap 3 - '@User/form/bootstrap_3_password.html.twig' ## .... for bootstrap 4 - '@User/form/bootstrap_4_password.html.twig'