| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function compose(View $view) |
||
| 11 | { |
||
| 12 | $honeypotConfig = config('honeypot'); |
||
| 13 | |||
| 14 | $nameFieldName = $honeypotConfig['name_field_name']; |
||
| 15 | |||
| 16 | if ($honeypotConfig['random_name_field_name']) { |
||
| 17 | $randomString = Str::random(); |
||
| 18 | session(['name_field_name' => $randomString]); |
||
| 19 | $nameFieldName = $randomString; |
||
| 20 | } |
||
| 21 | |||
| 22 | $enabled = $honeypotConfig['enabled']; |
||
| 23 | $validFromFieldName = $honeypotConfig['valid_from_field_name']; |
||
| 24 | |||
| 25 | $validFrom = now()->addSeconds($honeypotConfig['amount_of_seconds']); |
||
| 26 | |||
| 27 | $encryptedValidFrom = EncryptedTime::create($validFrom); |
||
| 28 | |||
| 29 | $view->with(compact( |
||
| 30 | 'enabled', |
||
| 31 | 'nameFieldName', |
||
| 32 | 'validFromFieldName', |
||
| 33 | 'encryptedValidFrom' |
||
| 34 | )); |
||
| 35 | } |
||
| 36 | |||
| 42 |