file($placeholderPath); } abort(404); } // Serve the file with proper headers return response()->file($filePath, [ 'Content-Type' => 'image/jpeg', 'Cache-Control' => 'public, max-age=31536000', // Cache for 1 year ]); } }