Guest User

Untitled

a guest
Mar 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public function register()
  2. {
  3. $this->app->singleton('encrypter', function ($app) {
  4. $config = $app->make('config')->get('app');
  5.  
  6. // If the key starts with "base64:", we will need to decode the key before handing
  7. // it off to the encrypter. Keys may be base-64 encoded for presentation and we
  8. // want to make sure to convert them back to the raw bytes before encrypting.
  9. if (Str::startsWith($key = $this->key($config), 'base64:')) {
  10. $key = base64_decode(substr($key, 7));
  11. }
  12.  
  13. return new Encrypter($key, $config['cipher']);
  14. });
  15. }
Add Comment
Please, Sign In to add comment