
👨💻สร้าง Web Application PHP Laravel ตอนที่ 17 การเข้ารหัส/ถอดรหัสข้อมูล
Channel:
Subscribers:
336
Published on ● Video Link: https://www.youtube.com/watch?v=O0eGukz0qbo
#Zentref #PHP #Laravel #WebApp
คำสั่งที่ใช้ในคลิปนี้
ไฟล์ Controller
use Crypt; //เรียกใช้งานตัว Crypt
// ฟังก์ชั่นเพิ่มข้อมูล
public function add(request $request){
$data = new User(); //สร้างobject เก็บข้อมูลเข้าโมเดลตาราง
// แปลงค่าเป็นอักษร encrypt
$data-›password = Crypt::encrypt($request-›password);
$data-›save();
return redirect('/home');
}
ไฟล์ blade.php
// ส่วนแสดงข้อมูลที่ถูกถอดรหัสแปลงค่ามา
{{Crypt::decrypt($r-›password)}}
Other Videos By Ikapayabaht
Tags:
Zentref
web
HTML
website
ภาษา html
css
CSS
html&css
javascript
php laravel
web application