1. Set up Laravel Project & Database
Update your .env
file with your DB credentials:
Run migrations:
2. Create Model, Migration, and Controller
Update the migration file database/migrations/xxxx_xx_xx_create_documents_table.php
:
Then migrate:
3. Define Fillable Fields in Model
In app/Models/Document.php
:
4. Set Up Routes
In routes/web.php
:
5. Create Form UI for File Upload
In resources/views/documents/create.blade.php
:
6. Store Logic in Controller
In app/Http/Controllers/DocumentController.php
:
7. Show All Documents
In resources/views/documents/index.blade.php
:
In Controller:
8. Edit & Update Logic
In resources/views/documents/edit.blade.php
:
In Controller:
9. Delete Document
In Controller:
10. Link Storage Folder
Run: