PHP code example of statikbe / laravel-security-txt
1. Go to this page and download the library: Download statikbe/laravel-security-txt library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
statikbe / laravel-security-txt example snippets
return [
// Enable/disable the /.well-known/security.txt route
'enabled' => env('SECURITY_TXT_ENABLED', true),
// Remote URL to fetch the template from
'template_url' => env('SECURITY_TXT_TEMPLATE_URL'),
// Days until expiration (default: 365)
'expires_days' => env('SECURITY_TXT_EXPIRES_DAYS', 365),
// Where to store the generated file
'output_path' => storage_path('security.txt'),
// Placeholder mappings
'placeholders' => [
'CONTACT_EMAIL' => '[email protected]',
'PGP_KEY_URL' => fn() => config('app.url') . '/pgp-key.txt',
],
// Middleware for the route
'middleware' => ['web'],
];