- if ($request->expectsJson()) {
- return response()->json(['validation' => $errors], 422);
- }
+ return response()->make($content, 200, [
+ 'Content-Type' => 'application/octet-stream',
+ 'Content-Disposition' => 'attachment; filename="' . $fileName . '"'
+ ]);
+ }
+
+ /**
+ * Show a positive, successful notification to the user on next view load.
+ */
+ protected function showSuccessNotification(string $message): void
+ {
+ session()->flash('success', $message);
+ }
+
+ /**
+ * Show a warning notification to the user on next view load.
+ */
+ protected function showWarningNotification(string $message): void
+ {
+ session()->flash('warning', $message);
+ }
+
+ /**
+ * Show an error notification to the user on next view load.
+ */
+ protected function showErrorNotification(string $message): void
+ {
+ session()->flash('error', $message);
+ }