Similar Posts

  • ทำความเข้าใจส่วนประกอบของเส้นทาง (Route) ใน Laravel กัน

    มาทำความเข้าใจส่วนประกอบของเส้นทาง (Route) นี้ทีละส่วนกันครับ: ตัวอย่าง Route::get(‘asset/getall’, [AssetController::class, ‘getall’])->name(‘asset.getall’); 1. Route::get() 2. ‘asset/getall’ 3. [AssetController::class, ‘getall’] 4. ->name(‘asset.getall’) สรุปการทำงานทั้งหมด:เมื่อมี request เข้ามาที่ URL /asset/getall ด้วย method GET→ Laravel จะเรียกใช้ method getall() ใน AssetController→ method นี้จะทำการดึงข้อมูลและส่งกลับ response ไปยังผู้ใช้ ตัวอย่างการใช้งานจริง:สมมติว่าเราต้องการดึงข้อมูล Asset ทั้งหมดจาก API ประโยชน์ของการตั้งชื่อ Route: ควรใช้เมื่อไหร่?

  • How to Setup Webserver On Ubuntu 22.04 with NGINX PHP MYSQL

    Setting up a web server on Ubuntu 22.04 using Nginx, PHP 8.2, and MySQL Server requires several steps. Follow this guide to install and configure everything correctly. Step 1: Update Your System Before installing any software, update your system packages: Step 2: Install Nginx Nginx is a lightweight and high-performance web server. Step 3: Install…

  • การเพิ่ม, ลบ, และแก้ไขคอลัมน์ใน Laravel ด้วย Migration

    ก่อนอื่น ถ้าต้องการแก้ไขตารางที่มีอยู่แล้ว ต้องใช้คำสั่ง make:migration โดยเพิ่ม –table=table_name เพื่อระบุว่าจะแก้ไขตารางไหน 1️⃣ การเพิ่มคอลัมน์ 🔹 ตัวอย่าง: เพิ่มคอลัมน์ phone และ address ในตาราง users ไฟล์ Migration ที่สร้างขึ้นจะอยู่ใน database/migrations/ และมีโค้ดเริ่มต้น ✏️ แก้ไขไฟล์ Migration: 📌 คำอธิบาย: ✅ รัน Migration: 2️⃣ การลบคอลัมน์ 🔹 ตัวอย่าง: ลบคอลัมน์ phone ออกจากตาราง users ✏️ แก้ไขไฟล์ Migration: ✅ รัน Migration: 3️⃣ การแก้ไขคอลัมน์ 📌 การแก้ไขคอลัมน์ใน Laravel ต้องใช้ doctrine/dbal package💡 ติดตั้ง package ก่อน…

  • 📌 Model ใน Laravel คืออะไร?

    Model ใน Laravel เป็นคลาสที่ใช้เชื่อมต่อและจัดการข้อมูลกับฐานข้อมูล โดยใช้ Eloquent ORM (Object-Relational Mapping) เพื่อให้สามารถเรียกใช้งานข้อมูลได้สะดวกขึ้น โดย Model จะเชื่อมโยงกับตารางในฐานข้อมูล โดยอัตโนมัติ 📌 โครงสร้าง MVC ใน Laravel 📌 การสร้าง Model ใน Laravel สามารถสร้าง Model ได้โดยใช้คำสั่ง Artisan CLI คำสั่งนี้จะสร้างไฟล์ Model ที่ app/Models/Product.php 📌 ตัวอย่าง Model (app/Models/Product.php) 📌 การใช้งาน Model กับฐานข้อมูล 1️⃣ ดึงข้อมูลจากฐานข้อมูล 📌 ดึงข้อมูลทั้งหมด (SELECT * FROM products;) 📌 ดึงข้อมูลแค่บางรายการ (SELECT * FROM products…

  • Let Profit Run EA

    1. การป้องกัน Drawdown สูงสุด (Max Drawdown Protection) 2. การป้องกันขาดทุนจาก Equity (Max Equity Loss Protection) 3. การจัดการ Hedge อัจฉริยะ (Smarter Hedge Management) 4. การเปิด Grid Order 5. การแสดงผลและข้อมูล 6. ฟังก์ชันช่วยเหลือ สรุป

  • PHP Artsan CLI Command For Laravel

    🔹 Laravel 11 Extensions & Packages Laravel has many useful extensions (packages) to enhance its functionality. Here are some commonly used ones: 1️⃣ Authentication & Security 🔹 Laravel Sanctum (API Authentication) 📌 Used for: Token-based API authentication. 🔹 Laravel Breeze (Simple Authentication) 📌 Used for: Lightweight authentication (Login, Register, Forgot Password). 🔹 Laravel Jetstream (Advanced…

Leave a Reply

Your email address will not be published. Required fields are marked *