Skip to content

Commit 1da2db8

Browse files
committed
docs: add PHP configuration snippets
1 parent 79d3394 commit 1da2db8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ symfonycasts_reset_password:
5757
enable_garbage_collection: true
5858
```
5959
60+
If using PHP configuration files:
61+
62+
<details>
63+
<summary>config/packages/reset_password.php</summary>
64+
65+
```php
66+
use App\Repository\ResetPasswordRequestRepository;
67+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
68+
69+
return static function (ContainerConfigurator $containerConfigurator): void {
70+
$containerConfigurator->extension('symfonycasts_reset_password', [
71+
'request_password_repository' => ResetPasswordRequestRepository::class,
72+
'lifetime' => 3600,
73+
'throttle_limit' => 3600,
74+
'enable_garbage_collection' => true,
75+
]);
76+
};
77+
```
78+
</details>
79+
80+
6081
The production environment may require the `default_uri` to be defined in the `config/packages/routing.yaml` to prevent the URI in emails to point to localhost.
6182

6283
```yaml
@@ -68,6 +89,23 @@ when@prod:
6889
default_uri: '<your project's root URI>'
6990
```
7091
92+
If using PHP configuration files:
93+
94+
<details>
95+
<summary>config/packages/routing.php</summary>
96+
97+
```php
98+
if ($containerConfigurator->env() === 'prod') {
99+
$containerConfigurator->extension('framework', [
100+
'router' => [
101+
'default_uri' => '<your project’s root URI>'
102+
],
103+
]);
104+
}
105+
```
106+
</details>
107+
108+
71109
### Parameters:
72110

73111
#### `request_password_repository`

0 commit comments

Comments
 (0)