Quantcast
Channel: 一言多いプログラマーの独り言
Viewing all articles
Browse latest Browse all 846

Laravel5.3で暗号化(Encryption)

$
0
0
Laravel5.3暗号化(Encryption)です。暗号化したものを元に戻せているからOKでしょう。

/app/Http/Controllers/BlogsController.php

use Illuminate\Contracts\Encryption\DecryptException;

$str = "Hello world テスト中!!" ;
print_r($str) ;
print "<br>" ;

// 暗号化
$str = encrypt($str) ;
print_r($str) ;
print "<br>" ;

// 復号化
try {
$str = decrypt($str) ;
print_r($str) ;
} catch (DecryptException $e) {
print_r($e) ;
}

参考サイト
Encryption(Laravel)

Viewing all articles
Browse latest Browse all 846

Latest Images

Trending Articles