18 | *
19 | * @method null|User find($id, $lockMode = null, $lockVersion = null)
20 | * @method null|User findOneBy(array $criteria, array $orderBy = null)
21 | * @method User[] findAll()
22 | * @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
23 | */
24 | class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
25 | {
26 | public function __construct(ManagerRegistry $registry)
27 | {
28 | parent::__construct($registry, User::class);
29 | }
30 |
31 | /**
32 | * Used to upgrade (rehash) the user's password automatically over time.
33 | */
34 | public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
35 | {
36 | if (!$user instanceof User) {
37 | throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
38 | }
39 |
40 | $user->setPassword($newHashedPassword);
41 | $this->getEntityManager()->persist($user);
42 | $this->getEntityManager()->flush();
43 | }
44 |
45 | public function save(User $user): void
46 | {
47 | $this->getEntityManager()->persist($user);
48 | $this->getEntityManager()->flush();
49 | }
50 |
51 | // /**
52 | // * @return User[] Returns an array of User objects
53 | // */
54 | // public function findByExampleField($value): array
55 | // {
56 | // return $this->createQueryBuilder('u')
57 | // ->andWhere('u.exampleField = :val')
58 | // ->setParameter('val', $value)
59 | // ->orderBy('u.id', 'ASC')
60 | // ->setMaxResults(10)
61 | // ->getQuery()
62 | // ->getResult()
63 | // ;
64 | // }
65 |
66 | // public function findOneBySomeField($value): ?User
67 | // {
68 | // return $this->createQueryBuilder('u')
69 | // ->andWhere('u.exampleField = :val')
70 | // ->setParameter('val', $value)
71 | // ->getQuery()
72 | // ->getOneOrNullResult()
73 | // ;
74 | // }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Security/RegisterUser.php:
--------------------------------------------------------------------------------
1 | passwordHasher->hashPassword(
23 | $user,
24 | $user->getPassword()
25 | );
26 |
27 | $user->setPassword($hashedPassword);
28 |
29 | $this->userRepository->save($user);
30 |
31 | $this->security->login($user);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/symfony.lock:
--------------------------------------------------------------------------------
1 | {
2 | "dama/doctrine-test-bundle": {
3 | "version": "7.3",
4 | "recipe": {
5 | "repo": "github.com/symfony/recipes-contrib",
6 | "branch": "main",
7 | "version": "4.0",
8 | "ref": "2c920f73a217f30bd4a37833c91071f4d3dc1ecd"
9 | },
10 | "files": [
11 | "config/packages/test/dama_doctrine_test_bundle.yaml"
12 | ]
13 | },
14 | "doctrine/doctrine-bundle": {
15 | "version": "2.11",
16 | "recipe": {
17 | "repo": "github.com/symfony/recipes",
18 | "branch": "main",
19 | "version": "2.10",
20 | "ref": "0db4b12b5df45f5122213b4ecd18733ab7fa7d53"
21 | },
22 | "files": [
23 | "config/packages/doctrine.yaml",
24 | "src/Entity/.gitignore",
25 | "src/Repository/.gitignore"
26 | ]
27 | },
28 | "doctrine/doctrine-fixtures-bundle": {
29 | "version": "3.5",
30 | "recipe": {
31 | "repo": "github.com/symfony/recipes",
32 | "branch": "main",
33 | "version": "3.0",
34 | "ref": "1f5514cfa15b947298df4d771e694e578d4c204d"
35 | },
36 | "files": [
37 | "src/DataFixtures/AppFixtures.php"
38 | ]
39 | },
40 | "doctrine/doctrine-migrations-bundle": {
41 | "version": "3.3",
42 | "recipe": {
43 | "repo": "github.com/symfony/recipes",
44 | "branch": "main",
45 | "version": "3.1",
46 | "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33"
47 | },
48 | "files": [
49 | "config/packages/doctrine_migrations.yaml",
50 | "migrations/.gitignore"
51 | ]
52 | },
53 | "friendsofphp/php-cs-fixer": {
54 | "version": "3.40",
55 | "recipe": {
56 | "repo": "github.com/symfony/recipes",
57 | "branch": "main",
58 | "version": "3.0",
59 | "ref": "be2103eb4a20942e28a6dd87736669b757132435"
60 | },
61 | "files": [
62 | ".php-cs-fixer.dist.php"
63 | ]
64 | },
65 | "phpstan/phpstan": {
66 | "version": "1.10",
67 | "recipe": {
68 | "repo": "github.com/symfony/recipes-contrib",
69 | "branch": "main",
70 | "version": "1.0",
71 | "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767"
72 | },
73 | "files": [
74 | "phpstan.dist.neon"
75 | ]
76 | },
77 | "phpunit/phpunit": {
78 | "version": "9.6",
79 | "recipe": {
80 | "repo": "github.com/symfony/recipes",
81 | "branch": "main",
82 | "version": "9.6",
83 | "ref": "7364a21d87e658eb363c5020c072ecfdc12e2326"
84 | },
85 | "files": [
86 | ".env.test",
87 | "phpunit.xml.dist",
88 | "tests/bootstrap.php"
89 | ]
90 | },
91 | "symfony/asset-mapper": {
92 | "version": "6.3",
93 | "recipe": {
94 | "repo": "github.com/symfony/recipes",
95 | "branch": "main",
96 | "version": "6.3",
97 | "ref": "e8c46ba5e488fc2d7462ab6832559ab93867370a"
98 | },
99 | "files": [
100 | "assets/app.js",
101 | "assets/styles/app.css",
102 | "config/packages/asset_mapper.yaml",
103 | "importmap.php"
104 | ]
105 | },
106 | "symfony/console": {
107 | "version": "6.3",
108 | "recipe": {
109 | "repo": "github.com/symfony/recipes",
110 | "branch": "main",
111 | "version": "5.3",
112 | "ref": "da0c8be8157600ad34f10ff0c9cc91232522e047"
113 | },
114 | "files": [
115 | "bin/console"
116 | ]
117 | },
118 | "symfony/debug-bundle": {
119 | "version": "6.3",
120 | "recipe": {
121 | "repo": "github.com/symfony/recipes",
122 | "branch": "main",
123 | "version": "5.3",
124 | "ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b"
125 | },
126 | "files": [
127 | "config/packages/debug.yaml"
128 | ]
129 | },
130 | "symfony/flex": {
131 | "version": "2.4",
132 | "recipe": {
133 | "repo": "github.com/symfony/recipes",
134 | "branch": "main",
135 | "version": "1.0",
136 | "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172"
137 | },
138 | "files": [
139 | ".env"
140 | ]
141 | },
142 | "symfony/framework-bundle": {
143 | "version": "6.3",
144 | "recipe": {
145 | "repo": "github.com/symfony/recipes",
146 | "branch": "main",
147 | "version": "6.2",
148 | "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3"
149 | },
150 | "files": [
151 | "config/packages/cache.yaml",
152 | "config/packages/framework.yaml",
153 | "config/preload.php",
154 | "config/routes/framework.yaml",
155 | "config/services.yaml",
156 | "public/index.php",
157 | "src/Controller/.gitignore",
158 | "src/Kernel.php"
159 | ]
160 | },
161 | "symfony/mailer": {
162 | "version": "6.3",
163 | "recipe": {
164 | "repo": "github.com/symfony/recipes",
165 | "branch": "main",
166 | "version": "4.3",
167 | "ref": "2bf89438209656b85b9a49238c4467bff1b1f939"
168 | },
169 | "files": [
170 | "config/packages/mailer.yaml"
171 | ]
172 | },
173 | "symfony/maker-bundle": {
174 | "version": "1.51",
175 | "recipe": {
176 | "repo": "github.com/symfony/recipes",
177 | "branch": "main",
178 | "version": "1.0",
179 | "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
180 | }
181 | },
182 | "symfony/messenger": {
183 | "version": "6.3",
184 | "recipe": {
185 | "repo": "github.com/symfony/recipes",
186 | "branch": "main",
187 | "version": "6.0",
188 | "ref": "ba1ac4e919baba5644d31b57a3284d6ba12d52ee"
189 | },
190 | "files": [
191 | "config/packages/messenger.yaml"
192 | ]
193 | },
194 | "symfony/monolog-bundle": {
195 | "version": "3.10",
196 | "recipe": {
197 | "repo": "github.com/symfony/recipes",
198 | "branch": "main",
199 | "version": "3.7",
200 | "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578"
201 | },
202 | "files": [
203 | "config/packages/monolog.yaml"
204 | ]
205 | },
206 | "symfony/notifier": {
207 | "version": "6.3",
208 | "recipe": {
209 | "repo": "github.com/symfony/recipes",
210 | "branch": "main",
211 | "version": "5.0",
212 | "ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc"
213 | },
214 | "files": [
215 | "config/packages/notifier.yaml"
216 | ]
217 | },
218 | "symfony/phpunit-bridge": {
219 | "version": "6.3",
220 | "recipe": {
221 | "repo": "github.com/symfony/recipes",
222 | "branch": "main",
223 | "version": "6.3",
224 | "ref": "1f5830c331065b6e4c9d5fa2105e322d29fcd573"
225 | },
226 | "files": [
227 | ".env.test",
228 | "bin/phpunit",
229 | "phpunit.xml.dist",
230 | "tests/bootstrap.php"
231 | ]
232 | },
233 | "symfony/routing": {
234 | "version": "6.3",
235 | "recipe": {
236 | "repo": "github.com/symfony/recipes",
237 | "branch": "main",
238 | "version": "6.2",
239 | "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6"
240 | },
241 | "files": [
242 | "config/packages/routing.yaml",
243 | "config/routes.yaml"
244 | ]
245 | },
246 | "symfony/security-bundle": {
247 | "version": "6.3",
248 | "recipe": {
249 | "repo": "github.com/symfony/recipes",
250 | "branch": "main",
251 | "version": "6.0",
252 | "ref": "8a5b112826f7d3d5b07027f93786ae11a1c7de48"
253 | },
254 | "files": [
255 | "config/packages/security.yaml"
256 | ]
257 | },
258 | "symfony/stimulus-bundle": {
259 | "version": "2.13",
260 | "recipe": {
261 | "repo": "github.com/symfony/recipes",
262 | "branch": "main",
263 | "version": "2.9",
264 | "ref": "05c45071c7ecacc1e48f94bc43c1f8d4405fb2b2"
265 | },
266 | "files": [
267 | "assets/bootstrap.js",
268 | "assets/controllers.json",
269 | "assets/controllers/hello_controller.js"
270 | ]
271 | },
272 | "symfony/translation": {
273 | "version": "6.3",
274 | "recipe": {
275 | "repo": "github.com/symfony/recipes",
276 | "branch": "main",
277 | "version": "6.3",
278 | "ref": "64fe617084223633e1dedf9112935d8c95410d3e"
279 | },
280 | "files": [
281 | "config/packages/translation.yaml",
282 | "translations/.gitignore"
283 | ]
284 | },
285 | "symfony/twig-bundle": {
286 | "version": "6.3",
287 | "recipe": {
288 | "repo": "github.com/symfony/recipes",
289 | "branch": "main",
290 | "version": "6.3",
291 | "ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c"
292 | },
293 | "files": [
294 | "config/packages/twig.yaml",
295 | "templates/base.html.twig"
296 | ]
297 | },
298 | "symfony/ux-twig-component": {
299 | "version": "2.13",
300 | "recipe": {
301 | "repo": "github.com/symfony/recipes",
302 | "branch": "main",
303 | "version": "2.13",
304 | "ref": "67814b5f9794798b885cec9d3f48631424449a01"
305 | },
306 | "files": [
307 | "config/packages/twig_component.yaml"
308 | ]
309 | },
310 | "symfony/validator": {
311 | "version": "6.3",
312 | "recipe": {
313 | "repo": "github.com/symfony/recipes",
314 | "branch": "main",
315 | "version": "5.3",
316 | "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c"
317 | },
318 | "files": [
319 | "config/packages/validator.yaml"
320 | ]
321 | },
322 | "symfony/web-profiler-bundle": {
323 | "version": "6.3",
324 | "recipe": {
325 | "repo": "github.com/symfony/recipes",
326 | "branch": "main",
327 | "version": "6.1",
328 | "ref": "e42b3f0177df239add25373083a564e5ead4e13a"
329 | },
330 | "files": [
331 | "config/packages/web_profiler.yaml",
332 | "config/routes/web_profiler.yaml"
333 | ]
334 | },
335 | "symfony/webapp-pack": {
336 | "version": "1.2",
337 | "recipe": {
338 | "repo": "github.com/symfony/recipes",
339 | "branch": "main",
340 | "version": "1.0",
341 | "ref": "aece95c8a188f6e6d04f01ccb8678d1764fd2642"
342 | },
343 | "files": [
344 | "config/packages/messenger.yaml"
345 | ]
346 | },
347 | "symfonycasts/reset-password-bundle": {
348 | "version": "1.18",
349 | "recipe": {
350 | "repo": "github.com/symfony/recipes",
351 | "branch": "main",
352 | "version": "1.0",
353 | "ref": "97c1627c0384534997ae1047b93be517ca16de43"
354 | },
355 | "files": [
356 | "config/packages/reset_password.yaml"
357 | ]
358 | },
359 | "symfonycasts/tailwind-bundle": {
360 | "version": "v0.2.1"
361 | },
362 | "twig/extra-bundle": {
363 | "version": "v3.8.0"
364 | }
365 | }
366 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | "./assets/**/*.js",
5 | "./templates/**/*.html.twig",
6 | ],
7 | theme: {
8 | extend: {},
9 | },
10 | plugins: [],
11 | }
12 |
--------------------------------------------------------------------------------
/templates/base.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% block title %}Welcome!{% endblock %}
6 |
7 |
8 | {% block stylesheets %}
9 | {{ ux_controller_link_tags() }}
10 |
11 | {% endblock %}
12 |
13 | {% block javascripts %}
14 | {{ importmap() }}
15 | {% endblock %}
16 |
17 |
18 | {% block body %}{% endblock %}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/templates/components/Footer.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
© 2023 Flowbite™ . All Rights Reserved.
25 |
26 |
27 |
--------------------------------------------------------------------------------
/templates/components/NavBar.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
--------------------------------------------------------------------------------
/templates/dashboard.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'layout.html.twig' %}
2 |
3 | {% block title %}
4 | Dashboard
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 |
12 |
This is great, but the Symfony is the best PHP framework in the world you can do so much more! You can do it! You are amazing and clever, so change this word! You can do it!
13 |
14 |
15 |
16 |
19 |
Marketing
20 |
Plan it, create it, launch it. Collaborate seamlessly with all the organization and hit your marketing goals every month with our marketing plan.
21 |
22 |
23 |
26 |
Legal
27 |
Protect your organization, devices and stay compliant with our structured workflows and custom permissions made for you.
28 |
29 |
30 |
33 |
Business Automation
34 |
Auto-assign tasks, send Slack messages, and much more. Now power up with hundreds of new templates to help you get started.
35 |
36 |
37 |
40 |
Finance
41 |
Audit-proof software built for critical financial operations like month-end close and quarterly budgeting.
42 |
43 |
44 |
47 |
Enterprise Design
48 |
Craft beautiful, delightful experiences for both marketing and product with real cross-company collaboration.
49 |
50 |
51 |
54 |
Operations
55 |
Keep your company’s lights on with customizable, iterative, and structured workflows built for all efficient teams and individual.
56 |
57 |
58 |
59 |
60 | {% endblock %}
--------------------------------------------------------------------------------
/templates/home.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'layout.html.twig' %}
2 |
3 | {% block title %}
4 | Symfony starter-kit home page
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 | All your need set up in few secondes. Feel whats greatness is with Symfony,
12 | the best PHP framework ever created.
13 | Go beyond the limits of PHP with Symfony.
14 |
15 |
16 | Learn more
17 |
18 |
19 |
20 |
21 |
22 | {% endblock %}
--------------------------------------------------------------------------------
/templates/layout.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'base.html.twig' %}
2 |
3 | {% block body %}
4 |
5 | {% block content %}{% endblock %}
6 |
7 | {% endblock %}
--------------------------------------------------------------------------------
/templates/reset_password/check_email.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'security_layout.html.twig' %}
2 |
3 | {% block title %}Password Reset Email Sent{% endblock %}
4 |
5 | {% block card_title %}Change Password{% endblock %}
6 |
7 | {% block content %}
8 |
9 | If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password.
10 | This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.
11 |
12 | If you don't receive an email please check your spam folder or try again .
13 | {% endblock %}
14 |
--------------------------------------------------------------------------------
/templates/reset_password/email.html.twig:
--------------------------------------------------------------------------------
1 | Hi!
2 |
3 | To reset your password, please visit the following link
4 |
5 | {{ url('app_reset_password', {token: resetToken.token}) }}
6 |
7 | This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.
8 |
9 | Cheers!
10 |
--------------------------------------------------------------------------------
/templates/reset_password/request.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'security_layout.html.twig' %}
2 |
3 | {% block title %}Reset your password{% endblock %}
4 |
5 | {% block card_title %}Reset your password{% endblock %}
6 |
7 | {% block content %}
8 |
9 | Enter your email address, and we will send you a
10 | link to reset your password.
11 |
12 | {% for flash_error in app.flashes('reset_password_error') %}
13 |
14 | {{ flash_error }}
15 |
16 | {% endfor %}
17 | {{ form_start(requestForm, {attr: {class: 'mt-4 space-y-4 lg:mt-5 md:space-y-5'}}) }}
18 | {{ form_label(requestForm.email, null, {label_attr: {class: 'block mb-2 text-sm font-medium text-gray-900 dark:text-white'}}) }}
19 | {{ form_widget(requestForm.email, {attr: {class: 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}}) }}
20 | {{ form_errors(requestForm.email, {attr: {class: 'mt-2 text-sm text-red-600 dark:text-red-500'}}) }}
21 | Reset passwod
22 | {{ form_end(requestForm) }}
23 | {% endblock %}
24 |
--------------------------------------------------------------------------------
/templates/reset_password/reset.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'security_layout.html.twig' %}
2 |
3 | {% block title %}Reset your password{% endblock %}
4 |
5 | {% block card_title %}Reset your password{% endblock %}
6 |
7 | {% block content %}
8 | {% for flash_error in app.flashes('reset_password_error') %}
9 |
10 | {{ flash_error }}
11 |
12 | {% endfor %}
13 | {{ form_start(resetForm, {attr: {class: 'mt-4 space-y-4 lg:mt-5 md:space-y-5'}}) }}
14 | {{ form_label(resetForm.plainPassword, null, {label_attr: {class: 'block mb-2 text-sm font-medium text-gray-900 dark:text-white'}}) }}
15 | {{ form_widget(resetForm.plainPassword.first, {attr: {placeholder: 'password', class: 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}}) }}
16 | {{ form_widget(resetForm.plainPassword.second, {attr: {placeholder: 'confirm password', class: 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}}) }}
17 | {{ form_errors(resetForm.plainPassword, {attr: {class: 'mt-2 text-sm text-red-600 dark:text-red-500'}}) }}
18 | Reset passwod
19 | {{ form_end(resetForm) }}
20 | {% endblock %}
21 |
--------------------------------------------------------------------------------
/templates/security/login.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'security_layout.html.twig' %}
2 |
3 | {% block title %}
4 | Sign in to your account
5 | {% endblock %}
6 |
7 | {% block card_title %}
8 | Sign in to your account
9 | {% endblock %}
10 |
11 | {% block content %}
12 | {% if error %}
13 | {{ error.messageKey|trans(error.messageData, 'security') }}
14 | {% endif %}
15 |
41 | {% endblock %}
42 |
43 |
--------------------------------------------------------------------------------
/templates/security/signup.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'security_layout.html.twig' %}
2 |
3 | {% block title %}
4 | Create an account
5 | {% endblock %}
6 |
7 | {% block card_title %}
8 | Create an account
9 | {% endblock %}
10 |
11 | {% block content %}
12 | {{ form_start(form, {'attr': {'class': 'space-y-4 md:space-y-6'}}) }}
13 |
14 | {{ form_label(form.email, null, {'label_attr': {'class': 'block mb-2 text-sm font-medium text-gray-900 dark:text-white'}}) }}
15 | {{ form_widget(form.email, {'attr': {'class': 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}}) }}
16 | {{ form_errors(form.email, {'attr': {'class': 'mt-2 text-sm text-red-600 dark:text-red-500'}}) }}
17 |
18 |
19 | {{ form_label(form.password, null, {'label_attr': {'class': 'block mb-2 text-sm font-medium text-gray-900 dark:text-white'}}) }}
20 | {{ form_widget(form.password, {'attr': {'class': 'bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500'}}) }}
21 | {{ form_errors(form.password, {'attr': {'class': 'mt-2 text-sm text-red-600 dark:text-red-500'}}) }}
22 |
23 | Create an account
24 |
25 | Already have an account? Login here
26 |
27 | {{ form_end(form) }}
28 | {% endblock %}
--------------------------------------------------------------------------------
/templates/security_layout.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'base.html.twig' %}
2 |
3 | {% block body %}
4 |
5 |
6 |
7 |
8 | Symfony StarterKit
9 |
10 |
11 |
12 |
13 | {% block card_title %}{% endblock %}
14 |
15 | {% block content %}
16 | {% endblock %}
17 |
18 |
19 |
20 |
21 | {% endblock %}
--------------------------------------------------------------------------------
/tests/Controller/HomeControllerTest.php:
--------------------------------------------------------------------------------
1 | request('GET', '/');
20 |
21 | $this->assertResponseIsSuccessful();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/Controller/SecurityControllerTest.php:
--------------------------------------------------------------------------------
1 | request('GET', '/sign-up');
20 |
21 | // assert user can sign up
22 | $client->submitForm('Create an account', [
23 | 'register_form[email]' => 'test@test.com',
24 | 'register_form[password]' => 'test',
25 | ]);
26 | $this->assertResponseRedirects('/dashboard');
27 |
28 | // assert user can logout
29 | $client->request('GET', '/logout');
30 |
31 | // assert user can login
32 | $client->request('GET', '/login');
33 | $client->submitForm('Sign in', [
34 | '_username' => 'test@test.com',
35 | '_password' => 'test',
36 | ]);
37 | $client->followRedirect();
38 | $this->assertResponseIsSuccessful();
39 |
40 | self::assertNotFalse($client->getResponse()->getContent());
41 | $this->assertStringContainsString('Welcome in your dashboard', $client->getResponse()->getContent());
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/tests/bootstrap.php:
--------------------------------------------------------------------------------
1 | bootEnv(dirname(__DIR__).'/.env');
13 | }
14 |
--------------------------------------------------------------------------------
/translations/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WebMamba/SymfonyStarterKit/390a4ef98a6d266cbda4812867ebb22e4c092be8/translations/.gitignore
--------------------------------------------------------------------------------