Eloquent ORM (Object-Relational Mapping) คือ เทคนิคแบบหนึ่งที่ทำงานร่วมกับฐานข้อมูลบน Laravel ที่ทำให้การจัดการข้อมูลในฐานข้อมูลเป็นไปอย่างสะดวกและเป็นระเบียบมากขึ้น
การบันทึกไฟล์ใน Database สำหรับ Laravel มีขั้นตอนดังต่อไปนี้
1.สร้าง Migration:
php artisan make:migration create_files_table –create=files
ใช้คำสั่ง php artisan make:migration create_files_table –create=files เพื่อทำการสร้างตารางในการจัดเก็บไฟล์
เมื่อได้ไฟล์ create_files_table มาแล้ว ให้ทำการแก้ไขดังนี้

จากนั่นทำการmigration เพื่อสร้างตาราง files ใน Database :
php artisan migrate
2.สร้าง Model: สร้าง Model สำหรับตั้งค่าการเก็บไฟล์ดังนี้
php artisan make:model File
โดยจะได้ไฟล์ของ Model ใน app/Models จะได้ File.php

3.เพิ่ม function uploadAndSave ใน Controller

จากนั่นสามารถเรียกใช้ function uploadAndSave ในการบันทึกไฟล์ในส่วนของเว็บได้เลย