/ credentials

credentials

credentials.js

// credentials.js

var credentials = {

};

module.exports = credentials;

git 忽略文件: credentials.js

使用 credentials.js:

// index.js
var credentials = require('./credentials');

credentials.php

<?php
// config/credentials.php
return [
	'cookieValidationKey' => 'v&T2Eg3!Qt1y1hRc&4@2'
];

git 忽略文件:credentials.php

使用 credentials :

// config/web.php
$credentials = require(__DIR__ . '/credentials.php');

$config = [
	//...
	'cookieValidationKey' => $credentials['cookieValidationKey'];
]