Performance: Uploading files
MEDIUM IMPACT
Uploading files affects page load speed and interaction responsiveness by impacting server response time and frontend resource handling.
<?php
public function upload(Request $request) {
$path = $request->file('upload')->store('uploads', 'public');
return back()->with('success', 'File uploaded to ' . $path);
}<?php
public function upload(Request $request) {
$file = $request->file('upload');
$file->move(public_path('uploads'), $file->getClientOriginalName());
return back()->with('success', 'File uploaded');
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous file move in controller | Minimal | 0 | Low | [X] Bad |
| Laravel storage with async/queued handling | Minimal | 0 | Low | [OK] Good |